Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
New Contributor

Qlik Sense - Nested Variable Evaluation

Is there a method to dynamically evaluate nested variables?

I am trying to allow my users the ability to dynamically select a variable for current, previous and next quarter. The vQtrSelect has a drop down extension that lets the users dynamically select this variable. This variable would then be evaluated in vCurrentQtr.

The vCurrentQtr variable is evaluated within set analysis in the measures. The below is what I am trying to accomplish but it is failing to evaluate the vQtrSelect variable.

LET vQtrSelect = 2;

LET vCurrentQtr = '=IF(vQtrSelect=1,QuarterName(Today(0),-1),IF(vQtrSelect=2,QuarterName(Today(0)),QuarterName(Today(0)),+1))';