Search code examples
qliksense

QlikSense: Pick function


I'm attempting something very simple. I have created a variable with values 1-4, with the intention of using this variable to select the appropriate datetime field depending on variable chosen:

enter image description here

This is what I have as the expression in my column:

enter image description here

When I test it by clicking 'Done editing', the changing the variable does not change the column's output. Does this function not do what I thought it does?


Solution

  • That should definitely work. Make sure you're setting it up correctly:

    Make sure your Variable Input object is using the correct variable:

    Screenshot of Qlik Sense Variable Input properties

    It looks like all of the values for your variable options are numeric which is correct but maybe doublecheck to make sure.

    If you continue to have issues, you could try using dollar-sign expansion to access the value of the variable directly in the expression, like so:

    =Pick( $(vT1) , name, rating, released)
    

    It should work the way you're doing it though:

    Screen recording of Qlik Sense Variable Input