Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problems with exclusion using set analysis

Hello,

I'm having a problem that I hope you can help me with:

I have the following data:

banana.PNG

I want to select all of the ProductType= Fruit when my actual Date (2015) is higher or iqual than DateStart and Lower or iqual than DateExpiration and exclude the ones that are Expired.

So far my expression syntax is like this:

=count({<ProductType={'Fruit'}, DateStart={"<=$(vActualDate)"}, DateExpiration={">=$(vActualDate)"}> - <ProductType={'Fruit'}, DateStart={"<=$(vActualDate)"}, DateExpiration={">=$(vActualDate)"}, Good/Expired={'Expired'}>} ProductName)

Everything works until the exclusion ( " - " ), what would be the correct syntax?

Thanks a lot

4 Replies
Gysbert_Wassenaar

Good/Expired might be interpreted as a division of Good by Expired instead of a field [Good/Expired]


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

I meant that, sorry it's just an example of the name of the field

Not applicable
Author

Hi Francisco,

Is there a reason why you cannot solely use your Good/Expired field to give you this? Just exclude out the expired data?

i.e Count({<ProductType={'Fruit'},[Good/Expired]={'Good'}>} ProductName)

or can you have 'good' that hasn't started yet?

If so create a flag in the script to help you. Something like

Load

..

If(Year(today())>=[DateStart] And Year(today())<=[DateExpiration],1) As GoodInDate_Flag

Count({<ProductType={'Fruit'},GoodInDate_Flag={1},[Good/Expired]={'Good'}>} ProductName)


hope that helps

Joe

Gysbert_Wassenaar

Can you post a qlikview document that demonstrates the problem?


talk is cheap, supply exceeds demand