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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
arusanah
Creator II
Creator II

Usage of set Analysis

Can we use set analysis in Where clause ??

e.g i have to find customer sales  for a payer for  years 2013 & 2014  normally we use it in expression as

({$<TimeLine.Year={2013,2014}>}Fact.CustomerSales)/1000

every time i select data  this condition gets re evaluated which makes app slower . i was wondering can we use this in where clause

where   ({$<TimeLine.Year={2013,2014}>).

pls suggest

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Unfortunately set analysis cannot be used in a where clause, in your query you can write:

...

where   TimeLine.Year='2013' or TimeLine.Year='2014'

let me know

buzzy996
Master II
Master II

NO.

Not applicable

Try with the follow approach:

in Load statement (example):

LOAD

Year,

if(Year=2013 or Year=2014,1,0) as Flag1314

FROM [...];

in Set Analysis

Sum({<Flag1314={1}>}Fact.CustomerSales)