Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
arsallee3
Contributor III
Contributor III

Sum Value based upon date time

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

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

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,

     ...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
Anonymous
Not applicable

Try this one:

I am assuming TicketDate is in 'DD/MMM/YYYY' format

=sum({1<TicketDate={'=$(=date(today(),'DD/MMM/YYYY'))'>}BblsQuantity)

jonathandienst
Partner - Champion III
Partner - Champion III

Its simpler if you have everything is in the default date format:

=Sum({<TicketDate = {'$=(Today())'}>} BblsQuantity)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

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,

     ...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Kushal_Chawda

if TicketDate format is in proper date format you can do this

sum({<TicketDate={">=$(=max(TicketDate)-1))"}>}BblsQuantity)

arsallee3
Contributor III
Contributor III
Author

I did the split and combination of the following string worked for me.

Sum({<TicketDateNum={'$(=date(today()-1))'}>}BblsQuantity)

I appreciate the assistance.