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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.