Hi All,
I want to use a Date variable dynamically in a text input object.
Requirement is, when user will select the any date from text input based on the selected date, no of day difference should come for all dates in a list table like below.
Text input 10/10/2024
Date Day Diff
08/10/2024 2
07/10/2024 3
06/10/2024 4
05/10/2024 5
04/10/2024 6
Hope some one will provide the solution.
Regards,
S Bakshi
Hey @shubha1babu! You can achieve this using a combination of a parameter and an expression. Since SAS dates are the number of days since Jan 1st 1960, you can subtract two dates from each other to get the number of days between them. In Visual Analytics, this works the exact same way. Let's get started.
Parse('Date (DD/MM/YYYY)'p, 'DDMMYY10') - 'Date'n
This expression says to read the value the user entered as a date in DDMMYY10 format, then subtract it from the date in the tableIf for some reason you run into a problem subtracting the date, try using "TreatAs(_number_, 'Date'n)" instead.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.