Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sushil353
Master II
Master II

set analysis for a condition?

Hi All,

in my application i have a varialble vfact.

in a expression i used a condition as

if(vfact=1,sum(prd_failures),sum(measurement_failures))

i have used a button to set or reset the variable values...

prd_failures and measurement_failures are fields from different tables...

Is it possible to achieve same functionality using set analysis...

Thanks

Sushil

5 Replies
Not applicable

add in your script a flag (1-0) in both tables so in your front end you can use set analysis about this flag

sushil353
Master II
Master II
Author

Hi dedagroup,

Can you give an example to use set analysis.

Thanks

sbaldwin
Partner - Creator III
Partner - Creator III

Hi if you really wanted to use set analysis you could do something like this but the question would be why not just use your If statement??

= sum( {<prd_failures={$(=if(vfact = 1,'*') )}  > } prd_failures)/

sum( {<measurement_failures={$(=if(vfact = 1,'*') )}  > } measurement_failures)

Thanks

Steve

sushil353
Master II
Master II
Author

I dont want to use if statement because my application slows down and takes time to perform calculations

Thanks Sbaldwin

erichshiino
Partner - Master
Partner - Master

Hi Sushil,

Why don't you set the field directly on your variable like this:

You set vFact to prd_failures or to measurement_failures

Then, your expression will be:

sum( $(vFact))

Hope this helps,

Erich