Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am looking to count the number of orders which have been completed today.
I've tried the following code:
sum( {$<ClosedDate = {$(Date-Today)}>} mrID)
Variable:
Date-Today = Today()
Data
mrID ClosedDate
1 18/09/2013
2 19/09/2013
3 19/09/2013
4 19/09/2013
Thanks,
Darren
Try:
sum( {$<ClosedDate = {'$(=Date(Today(),'DD/MM/YYYY'))'}>} mrID)
Unfortunately it returns a value of 0
Hi, In script create the flag based on, if(fabs(today()) = fabs(ClosedDate),1,0) as FLAG_NO_OF_ORDERS_CLOSED In Expression, sum(FRLAG_NO_OF_ORDERS_CLOSED) Regards Sathish
PFA. It works fine. The most likely issue is date format. You might want to share your sample app.
Hi,
If your mrID is an ID, then you have to count it and not to sum it.
Otherwise if it is the number of orders then you have to sum it.
The formula should be:
If mrID is an ID:
count({$<ClosedDate = {'$(=today())'}>} mrID)
If mrID is the number of orders:
sum({$<ClosedDate = {'$(=today())'}>} mrID)
Hi Tresesco,
Thanks for your sample data. The date format was the issue and was resolved by date(floor(Date)).
Thanks again for your help
Hi, Don't use count function in the expression. Because it takes lot of memory. So better create the flag in the script level. And in expression use sum(Flag). Regards Sathish