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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to write a set expression

Hi All,

Can any one help me on the below scenario, I have I fields like  ''sales'', and   Store open ,  ''Store number", "StoreKEY"" here Store Key has 1,2  numbers

Now  I want the current period sales when Store Open>15 and exclude the Storenumbers  those are having StoreKey 2  can any one guide me on the set analysis formula.

Regards

John

Labels (1)
6 Replies
kkkumar82
Specialist III
Specialist III

Try this

Sum({<Storeopen = {">15 "}, Storenumbers -={2} >   } Sales)

tresB
Champion III
Champion III

Not sure if understood right. May be:

sum( {$<[Store number]= E({1<StoreKEY={2}>} [Store number]), [Store Open]={">15"}>} Sales )

Not applicable
Author

Thanks Kiran Ch,  Tresesco.

Tresesco: can you please help me on  this, if Store open field is not there I need to find it with some expression like

sum({<[Store number]={"=sum({<StoreKey = E({1<StoreKey={'2'}>})>}Sales)>21"}>}Slaes) is this expression correct ?

tresB
Champion III
Champion III

Syntax looks okay. However, not knowing exactly what you are looking for, it would be a guess work. Could you create a sample qvw and share here explaining the expected output with logic?

Not applicable
Author

Thanks Tresesco.

ankitaag
Partner - Creator III
Partner - Creator III

Hi,

Current Period sales as in Current Calendar Year or month or CurrentFinancial Year?

Make a variable vYear for the current year or Financial Year (according to your requirement)

Expression would be :

sum({<Year={'$(vYear)'},StoreOpen={">(15)"},StoreKey-={2}>}Sales)