Hello All,
I have 2 Date Parameters, From_Date and To_Date. The difference between The 2 parameters should be less than or equal to 12 months.
For e.g : If the From_Date is set as ‘1/1/2022’ then the To_Date can be set with a maximum value of ‘12/31/2022’
If the From_Date is set as ‘6/1/2022’ then the To_Date can be set with a maximum value of ‘5/31/2023’
Is there any option to achieve the same
Thank you in advance
1 Like
@Vignesh_Kannan ,
I don’t think this is possible when you use the parameter with the datepicker control.
You have some flexibility to define what the default date would be for each parameter
Regards,
Koushik
1 Like
Hi @Koushik_Muthanna,
What you have shown is setting default dates for Parameter. In my case user can enter any date
Hello @Vignesh_Kannan , if your parameter allows the user to enter any date for start and end period it is not possible to prevent them to enter dates that are not valid according to your business logic.
Here one option that you have is to create two calculated fields (one for each date) and then perform a validation using a calculated field, e.g.
validation:
ifelse(dateDiff(start_date, end_date ,"MM") >= 12, "Dates are invalid, please select a range of 12 months between startd and end date", "Dates are valid")
Then you can include this field in a insight visual for example and include it in you dashboard to provide feedback to your end users. You can select a Top computation with a maximum of 1 element like this:
Hope it helps, I am marking this question as solved to help other members in the community, if you still have any further questions please let us know.
Thank you for posting into the QS community!
1 Like