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!!
May be you need this then
=Sum({<BoxIDField = {"=ItemTime > MaxTime"}>} #Box)
may be
=Sum({<ItemTime={"=ItemTime >= MaxTime"}>}#Box)
May be this
=Sum({<Product = {"=ItemTime > MaxTime"}>} #Box)
Hello Sunny,
I'm not the OP but I'm confused about the comparison between the Product and ItemTime. How should I interpret that? Just trying to gain more strength on complex set-analysis issues.
This might help clarify what I was trying to suggest (but apparently it might not have worked in this case )
It works.. But only if I have an element selected in the products field. Any idea about why?
Did you try this?
=Sum({<Product = {"=ItemTime > MaxTime"}>} #Box)
Use Product in set modifier, which must be primary field for your product table.
(Check sunny's reply)
Didn't work! I get just zero values with the expression
You do have a dimension called Product, right ... might sound dumb... but a lot of the times people just copy paste the expression without replacing the fields... you have to use the product field for Product in the expression I provided....