Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!!
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!
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....