Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paul_scotchford
Specialist
Specialist

Using dual values in variables

Hi All

I have created a dual value in my loaded calendar for a filter (on a qliksense sheet), the dual looks like this ...

Note: There are only 4 quarters for the purpose of this question.

text = 2015_Q4 number = 20154 in my loader, as dual(FinYearQtrName,FinYearQtrNum)

The filter will show the user a friendly Year/Qtr name i.e. 2015_Q1.


When the user selects a value from the filter I populate 2 variables predefined in the loader , via...

let vMaxFinQtrNum = '=num(max(FinYearQtrName))'

let vPrevFinQtrNum = '=vMaxFinQtrNum - 1'

The user will select for example 2015_Q4 which I can test and show in a KPI object as 20154 i.e '2015_Q4'

I would then expect the value of vPrevFinQtrNum to be 20153 i.e. 2015_Q3 , and i can show this in a kpi

as correctly calculated , so this part works as desired.

My problem is that the value for the previous period 20153 is not evaluating in a set analysis based calc ...

count({$< FinYearQtrNum={'$(vPrevFinQtrNum)' }>  } customer_Id  )

The expression returns a 0 , I was expecting for example 1000 for the previous period to the current period selected.

The expression to calculate the current period value works as expected for any filter value selected...

count({$< FinYearQtrNum={'$(vMaxFinQtrNum)' }>  } customer_Id  ) returns for example 1250.


So, has anyone seen this before when selecting a value that is dual from a filter and try to use the number part of the

selection such as what I am trying to do.


If the filter is just based on e.g. the number eg. 20154 instead, which is not visually friendly for some users,

then the above calcs work fine for this/prev period.


I'm stumped. Clearly I am missing something somewhere.


Any suggestions are appreciated.


This is being developed on a v2.01 QlikSense server .


Thanks


Paul

1 Solution

Accepted Solutions
paul_scotchford
Specialist
Specialist
Author

ok I have solved my problem, wood for the trees...

I needed to tell set analysis to ignore the FinYearQtrName   value, hence my SA looks like this ...

count({$<FinYearQtrName, FinYearQtrNum={'$(vPrevFinQtrNum)' }>  } customer_Id  )


View solution in original post

1 Reply
paul_scotchford
Specialist
Specialist
Author

ok I have solved my problem, wood for the trees...

I needed to tell set analysis to ignore the FinYearQtrName   value, hence my SA looks like this ...

count({$<FinYearQtrName, FinYearQtrNum={'$(vPrevFinQtrNum)' }>  } customer_Id  )