Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community,
today I have a problem with set analysis and dates. My goal to reach is to have a sum of a quantity in the month of today. Here what I have done:
Sum({$<TypeOfQuantity={"A"},[MonthName]={"=month(today())"}>}Quantity)
I've thought several solutions, but none of them worked.
My variable called MonthName is something like:
jan
feb
mar
...
dec
and in the setting of the script the name of the months are equal, i.e.:
jan
feb
mar
...
dec
Quite weird that if I put a constant in place of month(today()), it works!
So I tried
Sum({$<TypeOfQuantity={"A"},[MonthName]={"=month(date(today()))"}>}Quantity)
Sum({$<TypeOfQuantity={"A"},[MonthName]={"=monthname(today())"}>}Quantity)
But none of them worked.
How can I do it?
Hi Simone
You must to write your expression inside $(=EXPRESSION)
Sum({$<TypeOfQuantity={"A"},[MonthNum]={"$(=num(month(date(today()))))"}>}Quantity)
Try now
Hi,
In my opinion
Try to use numbers instead formatted dates. For example
Sum({$<TypeOfQuantity={"A"},[MonthNum]={"=num(month(date(today())))"}>}Quantity)
I don't know why but not always the date functions return a data well formatted and less with Set Analysis.
Regards
Hi Jose,
unluckily it does not work no one of these:
Sum({$<TypeOfQuantity={"A"},[MonthNum]={"=(month(today())"}>}Quantity)
Sum({$<TypeOfQuantity={"A"},[MonthNum]={"=month(date(today()))"}>}Quantity)
Sum({$<TypeOfQuantity={"A"},[MonthNum]={"=num(month(date(today())))"}>}Quantity)
Hi Simone
You must to write your expression inside $(=EXPRESSION)
Sum({$<TypeOfQuantity={"A"},[MonthNum]={"$(=num(month(date(today()))))"}>}Quantity)
Try now
Now it works fine, thanks!