I’ve broken this topic down into a four part series to make it easier to consume and to save you from copious amounts of scrolling. The accompanying video tutorial is already available and the below examples are linked to their corresponding timestamps in the video.
The control objects and examples I will cover in this series include:
In this example, I will prompt the user to select two date values formatted using Month Year (MMMYYYY). The list table will use these values as low and high boundaries for a between inclusive filter condition which will return consecutive weeks in the object. To show case a different filter, the bar chart on the other hand, will use these values to compare the two selected values rolled up to the month level.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
You may be wondering, why use the drop-down list instead of the slider (range)? Here are a few reasons:
The technique used in this example will follow these steps:
Use the page’s overflow menu to Expand page controls so that it is easy to see where you are dragging the Drop-down list control objects. Do not place the control object in the Page prompt area, but directly under it in the report canvas.
Remember, we need two! I placed mine side-by-side.
Next, we need to assign the Roles and use the object’s Title Option to label our control objects to assist our report users.
Here is the first control object:
And here is the second control object:
Now we will need to create two parameters to store the selected values from the Drop-down list control objects so that we can use these values in our filter expressions.
From the Data pane, use the New data item menu and select Parameter. Enter the new parameter information for the date data item. Be sure to select the correct Type and Format.
Repeat for the second parameter. Be sure to give the parameters meaningful names.
Next, we need to assign these parameters to their corresponding Drop-down list control objects’ Roles so that it stores the value selected.
Now we have our date boundaries which are being selected via the Drop-down list control objects and stored in our two parameters. Next we need to define and apply our Filters to our report objects.
First, we will define the filter for the List Table object. Recall that we want this to be a between inclusive for our two boundary values. Select the List Table object and then use the Filter pane and from the New filter menu select Advanced filter.
Next, build the filter expression for the Month Year date data item using the between inclusive condition and our two parameter items as the lower and upper boundaries.
Now we can build our filter for the Bar Chart object. This is where we want to compare the two selected months and therefore, will use a different kind of filter from the between inclusive, we will use an or condition.
With the Bar Chart object selected, use the Filter pane and from the New filter menu, select Advanced filter.
Next, build the filter expression for the Month Year date data item using an OR condition for both parameter values.
Success! Now test it out. You can see the list table object returns the between inclusive weeks for the date boundaries and the bar chart compares the two selected date values.
Here’s a summary of the technique for Example 3: Drop-down list:
How to prompt for a date range in a SAS Visual Analytics report Series:
Other References
Merci pour toutes ces explications bien explicites.
Mais les périodes de validité se chevauchent, si je choisi une date_begin bien précise, la date de fin va etre filtrée selon ce qu'il y a dans la table.
Alors qu'il y a peut etre une autre ligne qui pourrait etre afichée.
Voici une partie des dates de validité
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.