Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
suvechha_b
Creator III
Creator III

Need help in writing expression.

Help me in writing the following expression :

if (vAmountType)='Units' then

  [sum({<[Main Division Code Name]=>}sales_budget_units)]

{ elseif (vAmountType)='Value' then

[sum({<[Main Division Code Name]=>}sales_budget_units_value)]}

[ else

[0]]

end if

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

=if (vAmountType='Units' ,

  sum({<[Main Division Code Name]=>}sales_budget_units) ,

if (vAmountType='Value' ,

sum({<[Main Division Code Name]=>}sales_budget_units_value) ,0))

Note, your variable vAmountType might have to be expanded with '$' sign, like if($(vAmountType) ='Units'

View solution in original post

1 Reply
tresB
Champion III
Champion III

=if (vAmountType='Units' ,

  sum({<[Main Division Code Name]=>}sales_budget_units) ,

if (vAmountType='Value' ,

sum({<[Main Division Code Name]=>}sales_budget_units_value) ,0))

Note, your variable vAmountType might have to be expanded with '$' sign, like if($(vAmountType) ='Units'