
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count data from yesterday and today
Hi
I have one question.
I need to count data *Orders from yesterday and today. I tried to do with the bellow sentence
Previous day
Count({<Date = {"$(=Date(Max(Date) - 1,)"}>} OrderNumber)
+
Today
Count({<Date = {"$(=Date(Max(Date)"}>} OrderNumber)
Does not woks
Please help me
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count(
{$
<Date={"$(=Date(max(Date),'DD/MM/YYYY'))"}, Flag={0},Year=,Week=,Month=>
+
<Date={"$(=Date(max(Date)-1,'DD/MM/YYYY'))"}, Flag={1},Year=,Week=,Month=>
}
distinct OrderNumber)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be this
Count({<Date = {"$(='>=' & Date(Today() - 1, 'M/D/YYYY') & '<=' & Date(Today(), 'M/D/YYYY'))"}>}OrderNumber)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sunny,
It is works, Now I would like to see the same information, selecting, Year, Month, Week. It is possible to Count Date (today) + PrevDay (yesterday) value with diferents selections.
The measurment Counts all orders released before 16: 40hrs, identified Flag = 1, after 16: 40hrs Flag = 0, So I need to count all orders released today Flag = Flag = 1 Today + Flag = 0 Yesterday) through time.
I hope to be clear.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So you don't want to look at Today and Yesterday's value... you want Max selected date and max selected date -1 day value? May be this
Count({<Date = {"$(='>=' & Date(Max(Date) - 1, 'M/D/YYYY') & '<=' & Date(Max(Date), 'M/D/YYYY'))"}, Year, Month, Week>}OrderNumber)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I need to Count Yesterday Flag=0 + Today Flag=1.
this measurment returns the count for today
Count({<Date = {"$(='>=' & Date(Max(Date) - 1, 'DD/MM/YYYY') & '<=' & Date(Max(Date), 'DD/MM/YYYY'))"}, Year, Month, Week>} distinct Numero_OrdenVenta)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure I understand? Did it work?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No really, it return the count for Orders today, my idea is to have
Count Orders Today Flag = 1 + Count Orders Yesterday Flag =0
Count({<Date = {"$(='>=' & Date(Max(Date) - 1, 'DD/MM/YYYY') & '<=' & Date(Max(Date), 'DD/MM/YYYY'))"}, Year, Month, Week>} distinct Numero_OrdenVenta)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if(InDay(Date ,today(),0),1,0) as TodayFlag,
if(InDay(Date ,today(),-1),1,0) as YesterdayFlag,
Above 2 statements in your script
and in front end maybe
Count({<TodayFlag={1}>} distinct Numero_OrdenVenta) + Count({<YesterdayFlag={0}>} distinct Numero_OrdenVenta)
Not sure if this would work....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count(
{$
<Date={"$(=Date(max(Date),'DD/MM/YYYY'))"}, Flag={0},Year=,Week=,Month=>
+
<Date={"$(=Date(max(Date)-1,'DD/MM/YYYY'))"}, Flag={1},Year=,Week=,Month=>
}
distinct OrderNumber)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Massimo,
It´s works!!! when you select specific Date I mean '23/10/2017'.
In case select by week, month, Year, does not works.
I am missing something?
Thank you so much!

- « Previous Replies
-
- 1
- 2
- Next Replies »