Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

Nested IF statement as a variable in the Script

Question: How are the below variables written in the script? The Qlik Sense application sits on the SERVER, hence the requirement for                 SCRIPT VARIABLES.



vUserProductGroup

concat(Distinct Site_Master_Person_Product_Group)


vProductDivision   

=if($(vUserProductGroup) = 'MOBILE','IM', if($(vUserProductGroup) = 'TV','TVAV'))




This is the KPI expression:

*************************************************************************************************

if(vProductDivision = 'IM',

(sum({<[Product PREMIUM] = {'Premium'},[Product RM Division] = {$(vProductDivision)}>}Sell_Out_Qty)

/

sum({<[Product RM Division] = {$(vProductDivision)}>}Sell_Out_Qty)),

if(vProductDivision = 'TVAV',

(sum({<[Product PREMIUM] = {'PREMIUM'},[Product RM Division] = {$(vProductDivision)}>}Sell_Out_Qty)

/

sum({<[Product RM Division] = {$(vProductDivision)}>}Sell_Out_Qty))))

*************************************************************************************************


1 Reply

Re: Nested IF statement as a variable in the Script

May be look at Stefan's response here:

Re: Expression as a variable with $-sign expansion

Community Browser