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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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

1 Solution

Accepted Solutions
tresesco
MVP
MVP

=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
tresesco
MVP
MVP

=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'