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

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.

 

?

1 ACCEPTED SOLUTION

Accepted Solutions
vivek_sas
Obsidian | Level 7

> 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 )

View solution in original post

9 REPLIES 9
TejaSurapaneni
Lapis Lazuli | Level 10

Hi,

 

Can you please share the two charts info like roles

 

 

 

 

Thanks & Regards,

Teja Surapaneni

 

 

 

 

 

vivek_sas
Obsidian | Level 7

@mhamlett

 

> 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

mhamlett
Quartz | Level 8

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.

Sam_SAS
SAS Employee

The Year() operator will return the year from a date value as a number.

vivek_sas
Obsidian | Level 7

> 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 )

mhamlett
Quartz | Level 8

how do you convert a number to character?

Sam_SAS
SAS Employee
The Format() operator will return a string from a numeric. The name of this is sort of confusing, I know.
vivek_sas
Obsidian | Level 7

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

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 9 replies
  • 2185 views
  • 1 like
  • 4 in conversation