Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello! I want to sum all the sales on the latest three weeks.
Week | Sales |
202140 | 10 |
202142 | 9 |
202142 | 10 |
202141 | 11 |
202140 | 10 |
202132 | 30 |
202131 | 50 |
In this example, i would want to sum only the top 3 highest weeks (202140,202141 and 202142), returning a total of 50.
The expression that i wrote is not working, which is:
Sum({<[week] = {'>$(=Max(week,4))'}>} [sales])
I am unsure on why this operation is returning zero. on the other hand if i try to do a similar calculation looking only at the top one week, the following expression works perfectly:
Sum({<[week] = {'$(=Max(week))'}>} [sales])
I seen to be having an issue with the "greater than" sign and how it is evaluating my results. can anyone help me?
Hi, when you're trying to use comparisons in the set analysis, you must use the double quotes (") instead of single quotes (')
So, the expression should look like this:
SUM({<Week={">$(=MAX(Week,4))"}>}Sales)
Hi, when you're trying to use comparisons in the set analysis, you must use the double quotes (") instead of single quotes (')
So, the expression should look like this:
SUM({<Week={">$(=MAX(Week,4))"}>}Sales)