Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've got one question:
I need to create a bar chart. I'm using MonthYear as dimension and the expresion must to calculate:
sum(SALES) in current month / sum(SALES) from first day of month to current month.
Example:
MonthYear | SalesOfCurrentMonth | SalesOfYear | MyExpression |
---|---|---|---|
Oct14 | 10 | 10 | 10/10 |
Nov14 | 20 | 30 | 20/30 |
Dec14 | 10 | 40 | 10/40 |
Jan15 | 10 | 10 | 10/10 |
Feb15 | 20 | 30 | 20/30 |
Mar15 | 15 | 45 | 15/45 |
Apr15 | 5 | 50 | 5/50 |
I've problems to calculate the sales of the year, the condition are ignored and QV only sum the sales of the current month.
SUM({<MonthYear={">=YearStart(max($=MonthYear))}",
MonthYear={"<=max($=MonthYear)"}>} SALES)
Thak you!
Best Regards!
PS: the expression is an example. It's not a syntax problem 😉
would have to see how your months are defined, but might work if you switch it to min
SUM({<MonthYear={">=YearStart(min($=MonthYear))}", MonthYear={"<=max($=MonthYear)"}>} SALES)