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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

if statement within an expression qlikview

Hi,


I'm having issues trouble shooting an "if" statement.


i've tried looking at the data thats loaded.  I've checked the load.  Everything looks good.  Its a basic formula but is not returning the correct result for Facebook:-


Sample data:-

Module     Type               Value

AS          Facebook       90

KS          Facebook       70

AS          LinkedIn         50

if(Type='Facebook',if(Module='AS', sum(Value)))

Any help appreciated.

LC

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi Lauracastagna,

Try,

Sum({<Type={'Facebook'}, Module={'AS'}>}Value)

Or

Sum(If(Type='Facebook' and Module='AS', Value))

View solution in original post

2 Replies
lironbaram
Partner - Master III
Partner - Master III

hi try this syntax ,

this is a better way because this way you evaluate the conditions according to the line value

sum(if(Type='Facebook',if(Module='AS', Value)))

tamilarasu
Champion
Champion

Hi Lauracastagna,

Try,

Sum({<Type={'Facebook'}, Module={'AS'}>}Value)

Or

Sum(If(Type='Facebook' and Module='AS', Value))