user 123
user 123

Reputation: 41

If condition inside qlikview varaible

I want to show all employees who have greater than 10,000 amount i do this but this is not working

=if(RetBal < 10000,RetBal)

and then i save this in variable

Upvotes: 0

Views: 1241

Answers (2)

Stefan Stoychev
Stefan Stoychev

Reputation: 5012

Even if you are having one row per customer <-> RetBal you still need to use some aggregation function in your expression(s)

There are two ways to achieve this in your case:

  • IF

if( sum(RetBal) > 10000, sum(RetBal) )

Usually IF is slower so personally im trying to avoid it as much as possible. It's not a big issue if you have relatively small datasets. But with big data sets the delay is visible.

  • Set Analysis

sum( {< empId = {"=sum(RetBal) > 10000"} >} RetBal )

Set Analysis is considered faster because it doesn't scan the whole table

Can download example app from here

Upvotes: 1

Thomas Loehlein
Thomas Loehlein

Reputation: 51

I guess you just mistaken the greater than sign " > "

Upvotes: 0

Related Questions