Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I have a timestamp field CompletionDate
I want to count today's occurrencies of field MyField
I see I cannot put something like this as I get an error
Count({<Date(CompletionDate, 'DD/MM/YYYY')={$("=Date(Today(), 'DD/MM/YYYY')")} MyField)
and this returns zero
Count({<CompletionDate={$("=Date(Today(), 'DD/MM/YYYY')")} MyField)
How can I count today's coccurrencies then?
Ok, then if Timestamp format is mandatory it'll be more complicated because you will need a between set analysis (start and end of the day), if not, the best way is to change the format in script to a true date, by using floor/ceil function, combined with formatting ones, and then use the set analysis I've provided.
Hi,
If CompletionDate is a true Date field format (you can check it from data model, in tags list $date should be here), then:
Count({<CompletionDate={"$(=Date(Today(),'DD/MM/YYYY'))"}>} MyField) should works if both date display is 'DD/MM/YYYY'.
Best
@mpc It's a timestamp field not true date
I have made it work with this:
Count({1<CompletionDate={">=$(=Timestamp(Now()-1,'DD/MM/YYYY hh:mm:ss[.fff]'))"},CompletionDate={"<=$(=Timestamp(Now(),'DD/MM/YYYY 23:59:59[.fff]'))"}>} DISTINCT MyField)
but maybe there is a better way and concise way?
Ok, then if Timestamp format is mandatory it'll be more complicated because you will need a between set analysis (start and end of the day), if not, the best way is to change the format in script to a true date, by using floor/ceil function, combined with formatting ones, and then use the set analysis I've provided.