Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have three fields, Item, Customer and Percent Sales.
For each Item, I need to know how many Customers it takes to accumulate at least 80% sales.
For instance:
Item | Customer | PercentSales | Cumulative Sales |
1 | 1 | 10% | 10% |
1 | 2 | 25% | 35% |
1 | 3 | 10% | 45% |
1 | 4 | 20% | 65% |
1 | 5 | 20% | 85% |
1 | 6 | 5% | 90% |
1 | 7 | 5% | 95% |
1 | 8 | 5% | 100% |
2 | 1 | 5% | 5% |
2 | 2 | 5% | 10% |
2 | 3 | 5% | 15% |
2 | 4 | 5% | 20% |
2 | 5 | 20% | 40% |
2 | 6 | 20% | 60% |
2 | 7 | 25% | 85% |
2 | 8 | 10% | 95% |
2 | 9 | 5% | 100% |
Would give me the results:
Item | Count:CumulativeSales>=80 |
1 | 5 |
2 | 7 |
In Excel I could do a countif(CumulativeSales<=.8)+1
How could I do this in Qlikview?
Please help with the cummulative sum and the count statement
Thank you!
If you reload the data in your file, it also has the correct inline text, and will automatically correct itself.
So I ended up doing this in the script as it was easier... (see attached file)
That did it, thank you so much for your help!