Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
stighy
Contributor
Contributor

Year to date : how to filter dates ?

Hi. I've a table : 

DatePrest; Group field; ... some fields...; Revenue

I'd like to show an Year To Date table like this: 

Group Field;  Current Year Revenue; Previous Year Revenue

Where i need to filter dates for:

Current year= 2023-01-01  to 2023-05-21 

Previous year= 2022-01-01 to 2022-05-21

How to write correct set analysis ? 
Thanks

Labels (1)
1 Solution

Accepted Solutions
rubenmarin

Hi, the expressions could be:

- Sum({<DatePrest={">=$(=YearStart(Max(DatePrest)))<=$(=Max(DatePrest))"}>} Revenue)

- Sum({<DatePrest={">=$(=YearStart(Max(DatePrest),-1))<=$(=AddYears(Max(DatePrest),-1))"}>} Revenue)

Maybe you need to add a Date() function to enclose the expressions inside $()

 

View solution in original post

1 Reply
rubenmarin

Hi, the expressions could be:

- Sum({<DatePrest={">=$(=YearStart(Max(DatePrest)))<=$(=Max(DatePrest))"}>} Revenue)

- Sum({<DatePrest={">=$(=YearStart(Max(DatePrest),-1))<=$(=AddYears(Max(DatePrest),-1))"}>} Revenue)

Maybe you need to add a Date() function to enclose the expressions inside $()