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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
cristian_av
Creator III
Creator III

Best before by...

Hi

I need to separate product based on their expiration date. I have two fields called:

- "Max Time":  Products dimension, has the number of days that a product is still in good quality

- "Item Time":  Has the number of days since the product has been manufactured, from today.

I want to create an expression with set expression, to count all the products that are out-dated. I was trying with something like this, but is not working:

=Sum({<ItemTime={">$(=MaxTime)"}>}#Box)

How should I do this?

Thanks!!

21 Replies
cristian_av
Creator III
Creator III
Author

That was the solution!

I don't have the BoxId in the model, because they are a few millions, Instead I have the IDs of group of boxes, (called Pallet), but the date are at group of boxes level.

Just fot explanation, a "Pallet" can have multiple boxes, with multiple dates.

Should I include the BoxId or a key for each box, or is there any other way?

Thanks!

sunny_talwar
MVP
MVP

I guess you need to decide at what level do you want to carry out your calculation =ItemTime > MaxTime... are you looking to include/exclude boxes based on ItemTime and MaxTime or are you looking to include/exclude boxes and dates based on ItemTime and MaxTime? If you need the latter, you would need to create a new field which combines boxes with date and then test it....

alternatively, you can try to use an if statement as it seems to be done at a very granular level....