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: 
Anonymous
Not applicable

How to use variable in a Set Analysis

The following Set Analysis works.

Sum( {$<[login pass Last Access]={'Feb-17'}>} [login pass Total])

However, I create a variable for field [login pass Last Access] as vLoginPass,

when using the following Set Analysis with the above variable, not working any more

Sum( {$<[login pass Last Access]= {'$(=vLoginPass)'} >} [login pass Total]) , not working

Sum( {$<[login pass Last Access]= {'$(vLoginPass)'} >} [login pass Total]) , not working

Any suggestion is appreciated!

5 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi Haikou

Maybe so

Sum( {$<[login pass Last Access]= {$(vLoginPass)} >} [login pass Total])  or


Sum( {$<[login pass Last Access]= {$(#vLoginPass)} >} [login pass Total])


Regards,

Andrey



shraddha_g
Partner - Master III
Partner - Master III

Try

Sum( {$<[login pass Last Access]= {"=$(vLoginPass)"} >} [login pass Total])

Or

Sum( {$<[login pass Last Access]= {'$(vLoginPass)'} >} [login pass Total])

or

Sum( {$<[login pass Last Access]= {$(vLoginPass)} >} [login pass Total])

sasiparupudi1
Master III
Master III

Variable in script

Set vLoginPass='Feb-17';

Expression

Sum( {$<[login pass Last Access]= {'$(vLoginPass)'} >} [login pass Total])

hth

Sasi

Anil_Babu_Samineni

I doubt, Whether you have same format of index / Search / Selectors in your file list for [login pass Last Access]

Can you let us know the format of mentioned Values

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
priyasawant
Creator II
Creator II

create variable as vLoginpass=Feb-17

sum({<[login pass Last Access]={$(vLoginPass)}>}[login pass Total]))

i just want to know are you taking Feb-17 from any field or it is static.

if it is dynamic and you are taking the max i.e Feb-17 from the field then you must write

vLoginPass=max(mention the field from where Feb-17 is coming) and then use it in the above mentioned set analysis.