Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am working to get a sum based upon a date time field. I would like to sum value of field it day is equal to current date or previous date.
this is the formula currently have and just get the sum for all days, sure have some sytanx off slightly.
Sum({$<[Date(TicketDate)]={[today()]}>}BblsQuantity)
Thanks
Andy
If TicketDate is a timestamp with date and time components, split the components during load like:
LOAD ...
Date(Floor(TicketDate)) As TicketDate,
Time(Frac(TicketDate)) As TicketTime,
...
Try this one:
I am assuming TicketDate is in 'DD/MMM/YYYY' format
=sum({1<TicketDate={'=$(=date(today(),'DD/MMM/YYYY'))'>}BblsQuantity)
Its simpler if you have everything is in the default date format:
=Sum({<TicketDate = {'$=(Today())'}>} BblsQuantity)
If TicketDate is a timestamp with date and time components, split the components during load like:
LOAD ...
Date(Floor(TicketDate)) As TicketDate,
Time(Frac(TicketDate)) As TicketTime,
...
if TicketDate format is in proper date format you can do this
sum({<TicketDate={">=$(=max(TicketDate)-1))"}>}BblsQuantity)
I did the split and combination of the following string worked for me.
Sum({<TicketDateNum={'$(=date(today()-1))'}>}BblsQuantity)
I appreciate the assistance.