Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis

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.

MonthYearVolume
0220161
0420161
0720151
0820151
1020151
1020151
1020151
0920151
0520151
1020151
0120161
0320161
1120151
0120161
1020151
0120161
1020151
4 Replies
sunny_talwar

So what is the expected output from the sample you have provided above?

swuehl
MVP
MVP

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.

Anonymous
Not applicable
Author

Thanks a lot

swuehl
MVP
MVP

If your request is resolved, please consider closing this thread

Qlik Community Tip: Marking Replies as Correct or Helpful