Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
lotitolo
Contributor III
Contributor III

Cycle Measures, allow user to pick multiple measures

Hello to all,

I wanted to know if it was possible to give the user the possibility to select the measures (like a filter system) to choose if he wants to include them in in a customized measure.

I have illustrated this in the example below.
But I am not allowed to modify the structure of the table with the load editor.

I could have set this with a pivot but unfortunately I have one measure per column.

Do you have an idea, for example to play with variables ?

(if('$(vMeasure)'=1,num(Sum([Apple]),'0'))
+ if('$(vMeasure1)'=1,num(Sum([Orange]),'0'))
+ if('$(vMeasure2)'=1,num(Sum([Lemon]),'0')))

In my example the customized measure 'total sales' is adapted according to the selection 🙂

Capture d’écran 2020-12-23 à 19.50.33.png

Best regards,

Loïc

1 Reply
M_Bilto
Contributor II
Contributor II

Hello,

Selecting measures in qlik is not possible. However, you can perform a crosstable function in qlik (qlik's pivot table)

The issue is that you need at least 1 dimension to pivot on or else it wont work. But, here is what you can do.

 

I assume your load script looks something like this.

 

Load

Apple,

Orange,

Lemon,

From "data_source";

 

all you have to do is add a "dummy" field like this

ModifiedTable:

load

'A' as dummy,

Apple,

Orange,

Lemon,

From "data_source"

 

then perform this function on the table with the added string:

 

crosstable("Fruits" , "Values" , 1)

Load

Dummy,

Apple,

Orange,

Lemon

resident ModifiedTable;

 

then you can load it a third time and remove the dummy column if you want. and you will be left with fruits and values.

 

that way the names of your measure columns become row values under the dimension fruits. and fruits can be selected.

 

Hope this helps.