Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

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

Tags (2)
4 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Problems with exclusion using set analysis

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


talk is cheap, supply exceeds demand
Highlighted
Contributor III
Contributor III

Re: Problems with exclusion using set analysis

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

Not applicable

Re: Problems with exclusion using set analysis

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

Highlighted
MVP & Luminary
MVP & Luminary

Re: Problems with exclusion using set analysis

Can you post a qlikview document that demonstrates the problem?


talk is cheap, supply exceeds demand