Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
John_SM
Contributor III
Contributor III

Pivot table fixed dimension columns, before() issues

Hello there, I have a pivot table with 2 dimensions: monthname(Date) as columns and Countries as rows. I also have multiple filters. What I want is no matter the filter selection, the columns (the date dimension) should remain the same (in my case from Aug 2020 - today month).

For example if I select a country or any other selection from the filters the number of columns should be the same (from Aug 2020 until today). I have different expressions which I calculate with before() and after() function and whenever the columns change my numbers get also affected.

Is there a solution for this? Either the columns should be the same or something that doesn't affect my expressions with before() and after()

Thank you

3 Replies
hic
Former Employee
Former Employee

Sometimes the following trick can help:

  1. Add  " + Sum({1} 0) " to your measure. This will not change the number, but it will make the engine consider all dimensional values as possible. 
  2. Make sure that "Include null values" are checked for both dimensions.
John_SM
Contributor III
Contributor III
Author

Thank you for the answer @hic, but if I check the "Include null values" I have something like this:

John_SM_0-1644483076423.png

 

I tried to remove the nulls from country and date in the loading script with len(date) > 0 and len(country) > 0 but with no success

John_SM
Contributor III
Contributor III
Author

If I uncheck "Include null values" and I add "Sum({1} 0)" I get something like below. I select country Brazil and have all the other below with null values

 

John_SM_0-1644483833575.png