Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I get the number of products that is 80% to of total in a Text box

All:

I am trying to get the number of items where 80% of the cumulative total displayed in a text box.

An example of this is the following in a table format:

RankProductAmountCumulative Amount
1A2626
2B2551
3C2475
4D2398
5E22120
6F21141
7G20161
8H19180
9I18198
10J17215
11K16231
12L15246
13M14260
14N13273
15O12285
16P11296
17Q10306
18R9315
19S8323
20T7330
21U6336
22V5341
23W4345
24X3348
25Y2350
26Z1351

There are 26 products in this instance.

80% of 351 is 280.8

I want to display the number of products not over the cumulative amount inside a text box.  In this case it would be 14.

Any help on this would greatly be appreciated.

6 Replies
Anil_Babu_Samineni

Aaron,

QVW?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

May be this:

Count(DISTINCT {<Product = {"=RangeSum(Above(Sum(Amount), 0, RowNo()))/Sum(TOTAL Amount) <= 0.80"}>}Product)

antoniotiman
Master III
Master III

Sunny,

this works if Products are sorted by Amount.

I think You need Macro.

sunny_talwar

Very good point

Not applicable
Author

Yes my data is not necessarily in sorted order.

sunny_talwar

For anyone using QV12 or above, this should work:

=Count(DISTINCT {<Product = {"=Aggr(RangeSum(Above(TOTAL Sum(Amount), 0, RowNo(TOTAL))), (Amount, (NUMERIC, DESCENDING)), Product)/Sum(TOTAL Amount) <= 0.80"}>}Product)