i have a drop down with Year values in it. (ie. 2014 2015 2016)
i have two charts on the same tab.
i want the first chart filtered by the value in the drop down (ie. 2016)
i want the 2nd chart filtered by the value -1 in the drop down (ie 2016 -1=2015)
The value in the dropdown is character and a category.
?
> convert charcter to numeric in filter only using parse.
>In below year is in character i coverted it in to numeric
IF ( 'year Parameter'p NotMissing )
RETURN ( Parse('year'n, 'NUMX4.') = Parse('year Parameter'p, 'NUMX4.') - 1 )
ELSE ( 'year'n NotMissing )
Hi,
Can you please share the two charts info like roles
Thanks & Regards,
Teja Surapaneni
> Using paramaters it is possible but for that create dropdown list in the canvas only instead of section filter
>Create parameter from Dropdown
>Filter two tabs using filter
>ex- if year_paramteter notmissing
then year = year_parameter
else
year notmissing
> Year = your year field and year_parameter = parameter which we created from dropdown filter
>Use above logic for TAB1 and (Year_parameter -1) for TAB 2
Hope it will help you
how do i do math on a parameter. says type mismatch because the year is a category not a measure.
seems i need to convert the year to a number to subtract 1 from it.
The Year() operator will return the year from a date value as a number.
> convert charcter to numeric in filter only using parse.
>In below year is in character i coverted it in to numeric
IF ( 'year Parameter'p NotMissing )
RETURN ( Parse('year'n, 'NUMX4.') = Parse('year Parameter'p, 'NUMX4.') - 1 )
ELSE ( 'year'n NotMissing )
how do you convert a number to character?
Hi @mhamlett
If you found answer to your question . Can you please choose one of the replies as the solution by "Accepting it as a solution"? And perhaps mark the other as helpful by "Liking" it? This will help other community members who have the same question.
Thank you
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.