Search code examples
measureqliksense

Changing measure based on sheet


Is it possible to make a variable change in your measures based on the sheet that it is used in?

I have in about 15 measures and 3 sheets. The 15 measures need to vary slightly from sheet to sheet, so I wonder if it is possible to do someting like:

   sum(

         {<
            ,A={"1"} 
            ,B= 
            ,C=(IF SHEET = SHEET1 THEN {"1"}, IF SHEET = SHEET2 THEN {"2"}) 
            ,D= 
            ,E=  
         >} 

         people)

The alternative is to make 3x15 measures which is not very practical.


Solution

  • Hi yes you need to use extension for this for example:

    https://developer.qlik.com/garden/5a0972383a163ae72f86f26b
    

    you can check also other from https://developer.qlik.com/ There is no native function for that (it is in qlikview so maybe someday it will be implemented in qliksense too)

    Extension which url I shared add trigger on enterSheet so you need to set that this trigger "set variable" for example:

    Target:
    vSheetName
    
    Expression:
    'Sheet1'