BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Akhila1
Fluorite | Level 6

In creating a SAS viya dashboard I want the following calculated column as a category with % symbol

'Graduated in 2 Years'n / 'Enrolled (Distinct Count)'n

1 ACCEPTED SOLUTION

Accepted Solutions
Sam_SAS
SAS Employee

Oh, I see. The problem is the nested operations when you have an aggregated measure (Distinct Count) in the expression. I think the best workaround is to pre-calculate the distinct count as part of your data preparation.

 

If you have the very latest version of VA (2024.05), you can work around this by calculating the distinct count as part of an expression-based parameter.

View solution in original post

3 REPLIES 3
Sam_SAS
SAS Employee

Hello,

 

You can apply a Percent format to the numeric value, if you just want to display the % symbol.  (Change the data item properties in the Data pane.)

 

If you really need the value to be a category value, you can use the Format() operator.

 

For example,

Format('Engine Size (L)'n / 'Horsepower'n, 'PERCENT6.0')
returns a category value.
 
Let us know if that helps,
Sam

 

 

Akhila1
Fluorite | Level 6
I really need the value to be a category value. Format( 'Graduated in 2 Years'n / 'Enrolled (Distinct Count)'n,'PERCENT6.0')I get an error. Type mismatch. expected type at this location is Aggregated measure, type of this item being applied is character. Operand can only be aggregated, but this operator does not support aggregation. Thank you,
Sam_SAS
SAS Employee

Oh, I see. The problem is the nested operations when you have an aggregated measure (Distinct Count) in the expression. I think the best workaround is to pre-calculate the distinct count as part of your data preparation.

 

If you have the very latest version of VA (2024.05), you can work around this by calculating the distinct count as part of an expression-based parameter.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 353 views
  • 1 like
  • 2 in conversation