Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional Logic in Qlik Sense

Hi all,

I'm struggling with conditional logic that won't seem to work.

I have a field Value and I want to calculate the sum of teh field based upon a value in another field Category.

I have tried IF logic like this "if( Category= 'Income', (sum(Value) ))"

I have tried Set analysis like this "=Sum({$<Category={$(="Income")}>}Value)"

Neither works. Here is a screenshot of a table showing that there are data in both fields.

I hope someone can help me - I'm sure it's something really basic.

Many thanks in advance

Screen Shot 2017-01-09 at 16.17.11.png

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Sum({$<Category={'Income'}>}Value)

View solution in original post

3 Replies
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

Try :

Sum({<Category={'Income'}>} Value)

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!
sunny_talwar

Try this:

=Sum({$<Category={'Income'}>}Value)

Not applicable
Author

Many thanks to you both. Sunny's answer worked immediately.