Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calendar months and fixed calculations in a pivot table

I have a pivot table that has 2 dimensions - product description and month number (MONTH_NUM).
ScreenShot_401.png

In the expressions, I have 3 expressions for calculation:

1. Sum({<YEAR_TRN_DATE={'$(vGBL_PreviousYear)'}, MONTH_NUM={'<=$(vGBL_MaxMonth_Num)'}>} TRN_DET_STD_NTO)
2. Sum({<YEAR_TRN_DATE={'$(vGBL_MaxYear)'}, MONTH_NUM={'<=$(vGBL_MaxMonth_Num)'}>} TRN_DET_STD_NTO)

3. Column (2) - Column (1) = Difference

MONTH_NUM has 12 values from 1 - 12.

vGBL_PreviousYear point to previous year, vGBL_MaxYear is the current year, vGBL_MaxMonth_Num is the current month number

I'd like to make a pivot table that shows all calendar months as columns, and calculates the values in the columns by their respective months. Currently the pivot table shows only 2 months (Jan-Feb)

Does anyone have an example on how to do that?

1 Reply
marcus_sommer

The reason should be MONTH_NUM={'<=$(vGBL_MaxMonth_Num)'} and I think you didn't need it.

- Marcus