BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
_Dan_
Quartz | Level 8

Hi,

 

I don't often use Visual Analytics so I am sure this is a simple question for someone.

 

I'm filtering various list tables with drop-down boxes. One of those contains snapshot date & time. Snapshots are taken every 15 minutes and so the drop-down box contains a significant amount of values, and I'd like it to default to the max value every time the report is opened.

 

How do I do that please?

 

 

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
Sam_SAS
SAS Employee

The workaround is actually very simple! Smiley Very Happy

 

Apply a descending sort to the drop-down list and enable the "Initially select first item" option.

 

I'm pretty sure this should work, but let us know.

 

Thanks,

Sam

View solution in original post

15 REPLIES 15
Sam_SAS
SAS Employee
Hi Dan,

I don't think you can do this with a drop-down list but you can do it with a slider.

Sam
_Dan_
Quartz | Level 8

Hi Sam,

 

I've seen the options for the Date Slider to always utilise the min and max dates, so I'm using that already on a Time Series plot.

 

However, to see granular information in a List Table I need to be able to select a single datetime only in a filter object - which you can do with a Date Slider, but the Date Slider doesn't "snap" to the 15 minute sections that the datetime column contains. Dragging the filter triangle on the Date Slider results in no information being shown because it'll select something like "09:08:18" instead of "09:15:00", you have to expand the calendar and manually type a Date and Time. It's not a feasible option.

 

 

Dan

Sam_SAS
SAS Employee
I was hoping you could set both carets on the slider to the maximum value, but it doesn't appear possible.

I'll see if the development team has any ideas. In the meantime, maybe someone else on the community can offer a workaround.

Sam
Sam_SAS
SAS Employee

The workaround is actually very simple! Smiley Very Happy

 

Apply a descending sort to the drop-down list and enable the "Initially select first item" option.

 

I'm pretty sure this should work, but let us know.

 

Thanks,

Sam

_Dan_
Quartz | Level 8
Hi,

I completely forgot it had a right-click context menu - but I've found the Sort option for the RunDtTm column. Data is now sorted descending...

However, nowhere in the context menu nor any of the options in the right-hand sidebar come close to "initially select first item".

I'm using the drop-down list control option in VA 7.4 hfx10 if that's any help. Maybe this option was brought in with a higher hotfix?
Sam_SAS
SAS Employee
Oh no! I was thinking you were on 8.3.

Unfortunately I'm not sure if there is a way to do this on 7.4.
_Dan_
Quartz | Level 8
Ah, good thing I clarified it then 🙂

I'll mark your answer anyway as I'm sure it'll help someone who's on a higher version.
Sam_SAS
SAS Employee
Thanks Dan.

For what it's worth, we hope to include this option in the upcoming 7.5 release.
Sam_SAS
SAS Employee

Another thought about this -- you could force an object to always show the latest value by using a rank. I don't think that necessarily helps with your drop-down control, but it is another approach to showing the newest value.

_Dan_
Quartz | Level 8
Hi Sam

So, with the drop-down boxes I'm happy that you can order by Descending date, but the problem is where the report is saved with "Wednesday 17 2019 09:54:00" as the selected DateTime variable during report development and that is the retained value every single time you open the report - even six months down the line.

Are you suggesting that a rank could be used to manipulate the selected value in the drop-down box upon the report being opened? Is there a way to ensure the rank also doesn't manipulate the data insofar as a "top 10" would ultimately limit the amount of DateTime records available for selection?



Dan
Sam_SAS
SAS Employee

Hi Dan,

I think the ranking does not directly help you with your issue. But you could set a ranking to select the top 1 date to create an object that always displays the data for the most recent date value.

I'm not sure if that would actually be appropriate for your report, but you seemed interested in showing the most recent date.

 

Sam

Stu_SAS
SAS Employee

Hi all,

 

Here's how I've been selecting the max upload date by default. This will require a few different steps:

 

  1. In your source data, create a flag that specifies the maximum value of your column of interest. If the column is the max value, it's a 1. If not, it's a 0. Let's call this column "max_upload_date_flag."

  2. Create a new date parameter called "Upload Date" and attach it to the drop-down list

  3. For every object on the page, add the following advanced filter:
if(missing('Upload Date'p) ) return 'flag_max_upload_date'n = 1
else 1=1

How does this work?

When the drop-down list is cleared, the parameter 'Upload Date'p has no value. When it has no value, the object-level filter takes over and only returns the maximum upload date since we've defined the filter to only activate when this condition exists. When the drop-down list is selected, the object filter returns an always-true condition. In other words, the object filter does nothing, and the drop-down filter takes over.

 

This works in VA 7.4, 8.1, 8.2, and 8.3.

_Dan_
Quartz | Level 8
Thanks for your response, I've been on annual leave but will see if I can implement this soon.
romeomai
Calcite | Level 5
@Stu_SAS, your solution helped solve my problem with display latest set of data in VA 7.4. Thank you

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 15 replies
  • 4459 views
  • 1 like
  • 4 in conversation