Calendar filtering based on 2 date fields

Hello @Carlos_Ranel, Thank you for posting your query. Based on my understanding of your problem, I have tried a solution approach. Please find the details below.

Step 1 : Created a Sample Dataset having the following columns where I have 3 different date fields Order Date, Ship Date and Delivery Date.

image

Step 2 : Create 2 parameters and attach a Date Picker control to both of them so that users can select the Start Date and End Date respectively using the controls.

Step 3 : Create a Calculated Field (e.g. Matching Criteria) with a logic similar to the below based on your use case. Here I am trying to see the products whose Order Date or Ship Date belong to the range selected by the user using the Calendar Controls. You can change it according to your need, but the concept remains same

ifelse(({order_date} >= ${paramStartDate} AND {order_date} <= ${paramEndDate}) OR ({ship_date} >= ${paramStartDate} AND {order_date} <= ${paramEndDate}), 1, 0)

Step 4 : Mark this new Calculated Field as Dimension and bring it to your Table Visual and ensure that you hide the column in your visual.

Step 5 : Create a filter on the Visual with the criteria the the new Calculated Filed (i.e. Matching Criteria) is always equal to 1.

This should solve your use case. Hope this helps!

Did my suggestion help you in resolving your query? If yes, would request you to mark the post as “Solution”. This will help the community to find guidance and answers to similar question. Thank you!

2 Likes