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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
fmazzarelli
Partner - Creator III
Partner - Creator III

sum + case

hi,

I would make the sum of two fields conditioned by another value
example :
case white

     sum(1+10):

case red

     sum(2+20)

else

     sum(3+20)


11 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,


Try like this


Pick(WildMatch(FieldName, 'white', 'red', '*'),

     Sum({<field -= {'VALUE'}>}),

     Sum({<field -= {'VALUE'}>}),

     Sum({<field -= {'VALUE'}>}))


Qlikview compiler will show the above expression as error but it works, because -= it will show error.



Hope this helps you.


Regards,

Jagan.


jagan
Partner - Champion III
Partner - Champion III

Hi,

If you got the answer please close this thread by giving Correct Answer to the useful post.

Regards,

Jagan.