Access 2003/XP
Hello, I have a query that shows a running total and percentile of the number of claims our company gets for each type of claim. The field expressions in the design of the query look like this:
Type: [Type]
Claims: [Claims]
RunTotal: DSum("Claims"," ClaimsType","[Claims] >= " & [Claims])
Percentile: [RunTotal]/80952144
Included: IIf([Percentile]<0.75,"Yes","No ")
"RunTotal" is sorted in descending order, "ClaimsType " is the table the query is based off of, 80952144 is the total sum of all claims (entering Sum(Claims) only gives the sum for each "Type").
My question here is with the "Included" field, which takes the cutoff point at everything within the top 75th percentile. What I would like it to do, is if it could somehow take one additional "Type" over .75 to ensure that at least 75% of "claims" is covered. For example, what it shows now is:
Type Claims RunTotal Percentile Included
A 10 10 50% Yes
B 4 14 70% Yes
C 3 17 85% No
D 2 19 95% No
E 1 20 100% No
But I would need it to show "Yes" for Type C, since A and B alone would not cover 75% of the total claims. Also, sometimes there is a "tie" at the cutoff point, which might complicate things further. Then it would look like:
Type Claims RunTotal Percentile Included
A 10 10 50% Yes
B 4 14 70% Yes
C 2 18 90% No
D 2 18 90% No
E 1 20 100% No
In this case I would need both C and D to have "Included" as "Yes". Hopefully this doesn't complicate things too much, and any help would be greatly appreciated.
Hello, I have a query that shows a running total and percentile of the number of claims our company gets for each type of claim. The field expressions in the design of the query look like this:
Type: [Type]
Claims: [Claims]
RunTotal: DSum("Claims"," ClaimsType","[Claims] >= " & [Claims])
Percentile: [RunTotal]/80952144
Included: IIf([Percentile]<0.75,"Yes","No ")
"RunTotal" is sorted in descending order, "ClaimsType " is the table the query is based off of, 80952144 is the total sum of all claims (entering Sum(Claims) only gives the sum for each "Type").
My question here is with the "Included" field, which takes the cutoff point at everything within the top 75th percentile. What I would like it to do, is if it could somehow take one additional "Type" over .75 to ensure that at least 75% of "claims" is covered. For example, what it shows now is:
Type Claims RunTotal Percentile Included
A 10 10 50% Yes
B 4 14 70% Yes
C 3 17 85% No
D 2 19 95% No
E 1 20 100% No
But I would need it to show "Yes" for Type C, since A and B alone would not cover 75% of the total claims. Also, sometimes there is a "tie" at the cutoff point, which might complicate things further. Then it would look like:
Type Claims RunTotal Percentile Included
A 10 10 50% Yes
B 4 14 70% Yes
C 2 18 90% No
D 2 18 90% No
E 1 20 100% No
In this case I would need both C and D to have "Included" as "Yes". Hopefully this doesn't complicate things too much, and any help would be greatly appreciated.
Comment