Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone !
I have a list with sales date in this format (eliminating the time, so there are recurring dates) and the sales.
Date | Sale | |
---|---|---|
| 10 | |
| 11 | |
| 12 | |
| 12 | |
| 5 | |
| 9 | |
| 15 | |
| 8 | |
| 8 | |
| 3 | |
| 20 | |
| 9 |
I want to make a line graph showing me the sum of the two highest sales since the beginning of time starting from the first date. Thus becomes:
Date | Sale | |
---|---|---|
| 21 | |
| 24 | |
| 24 | |
| 27 | |
| 27 | |
| 27 | |
| 35 |
I have tried many "measures" to make this graphic but no results. Any suggestions?
Regards !
It seems to be working, isn't it?
Yes Sunny !
It seems to be working perfectly, the part of "Rangesum( FirstSortedValue(Sale, -Sale- recID/100000,1), FirstSortedValue(Sale, -Sale- recID/100000,2))" its amazing.
However, I dont understand -Sale- recID/100000.
I've been all afternoon trying to apply the function to another problem and I could not. Can you explain me ?
Sorry for your time Sunny, I am new in this.
Thank you very very much.
The second argument -Sale-recID/100000 is the sort weight for the Sales field. It's used to distinguish between ties, i.e. in your sample between the repeated values of 12.
We somehow need QV to find '12' as max number, but also '12' as second largest number in your series of values, e.g. on 03-08-2015.
So I've added a small unique number, record number divided by 100000. (the added number should be much smaller than the smallest difference between your Sale values).
Hope this makes sense,
Stefan
Thank you very much Stefan
Thank you for your explanations and time!