Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys, I'm looking to make a few buttons that allow for the dates that I have in my data to be selected.
For example: I have a field called ReportingDate and I want to create an expression that selected YTD values.
vReportingDate = '>' (YearStart(Max(ReportingDate ))) & '<=' ((Max(ReportingDate )))
How can I make my variable select all the dates between these values?
Hello,
I am not sure that I have completely understood the use case scenario, however my assumption is that you would like to create a button, that when clicked, it will select a specific range of dates from the dataset. In that case, you can follow the following steps:
1. I have the following dataset:
2. I have created a button with the following configuration:
Action: "Select values matching search criteria"
Field: [THE FIELD THAT YOU WANT TO APPLY THE SELECTIONS TO]
Value: ='>=$(=YearStart(Min(OrderDate)))<=$(=Max(AddYears(OrderDate, -3)))'
This is just a demo expression (to demonstrate the idea of how it works), that will select values where date is grater than the minimum date and lower than the maximum date (But 3 years earlier)
3. After clicking the button, this is what I get:
As you can see, only specific date range was selected from the dataset.
4. In your use case scenario, you might try using the following expression:
='>$(=YearStart(Max(ReportingDate)))<=$(=Max(ReportingDate))'
I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional details. Otherwise, if it has helped you resolve the issue, please mark it as accepted solution to give more visibility for other community members.
Hello,
I am not sure that I have completely understood the use case scenario, however my assumption is that you would like to create a button, that when clicked, it will select a specific range of dates from the dataset. In that case, you can follow the following steps:
1. I have the following dataset:
2. I have created a button with the following configuration:
Action: "Select values matching search criteria"
Field: [THE FIELD THAT YOU WANT TO APPLY THE SELECTIONS TO]
Value: ='>=$(=YearStart(Min(OrderDate)))<=$(=Max(AddYears(OrderDate, -3)))'
This is just a demo expression (to demonstrate the idea of how it works), that will select values where date is grater than the minimum date and lower than the maximum date (But 3 years earlier)
3. After clicking the button, this is what I get:
As you can see, only specific date range was selected from the dataset.
4. In your use case scenario, you might try using the following expression:
='>$(=YearStart(Max(ReportingDate)))<=$(=Max(ReportingDate))'
I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional details. Otherwise, if it has helped you resolve the issue, please mark it as accepted solution to give more visibility for other community members.
Perfect solution, thank you!