BookmarkSubscribeRSS Feed
vietlinh12hoa
Obsidian | Level 7

 I would like to add a dummies categories column "Level" (1,2,3) just for filtering purpose. What I have in mind is:

If _n_ = 1 then Level = 1

else (if _n_ = 2 then Level =2

         else Level = 3)

 

The first row is Level 1, second row is Level 2, the rest of table is assigned to Level 3. But it seems the syntax in Viya is different with SAS EG.

3 REPLIES 3
Sam_SAS
SAS Employee

Are you are talking about a dummy column to use as selector labels in a report prompt (button bar, etc)?

 

If you are creating the column within VA, one way is to create a custom category with three value groups, then just put some arbitrary values in each group.

 

Sam

vietlinh12hoa
Obsidian | Level 7
Thanks it seems a quick solution. but it only for numeric, right? In case the level is character maybe if else it's still needed.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 3 replies
  • 1430 views
  • 2 likes
  • 3 in conversation