Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to show Sum of Volume based on the user selection of month and year. Also will have to show the subsequent sums of the volume for 5 months which are prior to the selected month, grouped by the month field.
| Month | Year | Volume |
| 02 | 2016 | 1 |
| 04 | 2016 | 1 |
| 07 | 2015 | 1 |
| 08 | 2015 | 1 |
| 10 | 2015 | 1 |
| 10 | 2015 | 1 |
| 10 | 2015 | 1 |
| 09 | 2015 | 1 |
| 05 | 2015 | 1 |
| 10 | 2015 | 1 |
| 01 | 2016 | 1 |
| 03 | 2016 | 1 |
| 11 | 2015 | 1 |
| 01 | 2016 | 1 |
| 10 | 2015 | 1 |
| 01 | 2016 | 1 |
| 10 | 2015 | 1 |
So what is the expected output from the sample you have provided above?
I would suggest that you create a MonthYear field:
LOAD Month,
Year,
MonthName(Makedate(Year, Month)) as MonthYear,
Year*12+Month as MonthYearNum
FROM ...;
Then you can use a set expression like
=Sum(
{<MonthYearNum = {">=$(=Max(MonthYearNum)-5)<=$(=Max(MonthYearNum))"}, Month, Year, MonthYear>}
Volume)
Use this in a chart with dimension MonthYear.
Thanks a lot
If your request is resolved, please consider closing this thread