Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
coekaertss
Contributor
Contributor

use of variable and total together in expression

I created a P&L statement.

Now I want to use a variable (vPeriodSelection), which contains 3 buttons (Period, Quarter-Year, Semester-Year) at the top of the screen.

Purpose is that a user clicks on on of the 3 options and depending on the button, period (month), quarter or semester is displayed. That works fine, but with the calculation of the percentage, it is calculating the total of the dimension for column (Period Multiple), which contains the variable.

If I do not use that column, and use the Period, Quarter-Year or Semester-Year column directly in the pivot, then it calculates it nicely per period or quarter ...

But if you look at the expression of the measure below, then you see, that for vPeriodSelection, it is translating it in Quarter-Year (so what the user choose)  ... So it looks like, that total doesn't look at a variable dimension between the square brackets... It needs to be the dimension itself ...

Any ideas?

coekaertss_1-1600431221438.png

 

coekaertss_2-1600431246276.png

coekaertss_3-1600431272398.png

 

 

3 Replies
Qlik1_User1
Specialist
Specialist

Try like this

{$(=v_Selection)} OR {"=$(=v_Selection)"}

coekaertss
Contributor
Contributor
Author

Unfortunately, that didn't work ...

 

sunny_talwar

@coekaertss Can you try this

$(=$(vPeriodSelection))