Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I hope somebody can help me.
I've to calculate to total orders (number of received order) at three distinct moments:
today
today - xx days
today - xx * 2 days
For example:
number of orders received today: 100
number of order received today - 2 = 90
number of orders received (today - 2 * 2) = 95
Where xx is a number that the user can set by a slider
I've the following expression:
var_daybefore = 2
= count({<TDATE={"$(=Date(Max(TDATE)- $(var_daybefore) ,'DD/MM/YYYY'))"}>} TORDERS)
The expression above, calculates the number of orders received two days ago and it's correct
I need to calculate the same value , but related to (2 * 2) = 4 days ago:
= count({<TDATE={"$(=Date(Max(TDATE)- $(var_daybefore) * 2 ,'DD/MM/YYYY'))"}>} TORDERS)
but it doesn' t work
In short term, the second expression is based on user choise: if the user choose 2 days, I've to compare the values of
today
today - 2
today - 4
Help please !!
Thanks in advance
The expression looks correct to me. It ought to work. Are you sure the are TORDERS for that date?
Can you could try this?
count({<TDATE={"$(=Date(Max(TDATE) - $(var_daybefore) - $(var_daybefore) ,'DD/MM/YYYY'))"}>} TORDERS)