BookmarkSubscribeRSS Feed
AB_prv
Calcite | Level 5

Hi all,

 

if have a measure in VA 8.3 which is defined by a IF-RETURN-ELSE Statement, let's call it test-measure:

 

IF 'parameter'p = "a"

RETURN 0.01

ELSE 1

 

I would like to have percent12.2 'if parameter'p = "a" and comma12. if 'parameter'p ^= "a". But formats in VA are linked to the format of test-measure. I tried to define a character-variable called format by

 

IF 'parameter'p = "a"

RETURN "COMMA12."

ELSE "PERCENT12.2"

 

and changed the xml file of my report by adding the variable name of my new character variable to the format statement of the old one, but it did not work(the code looked like this:

 

(<AggregateCalculatedItem dataType="double" name="bi5139" label="Berichtsgröße" format="bi1234">
<Expression>cond(eq(#{pr2548},'Relationen'),times(${bi5044,raw},100),${bi5134,raw})</Expression>

 

VA could not recognize it and compiled the variable as BESTX.

 

Is there any other workaround for my problem?

3 REPLIES 3
Reeza
Super User
That's a common issue in most DBs, you cannot have a single column have multiple types. What you can do is have the value pre-formatted and push it in as a character, but then you can't summarize/aggregate it. You may be better off splitting this into two variables?
AB_prv
Calcite | Level 5

Thank you for your suggestion, but that is not possible. Ich have a crosstable with more than 100 different variables, which are collected in one display-variable by a IF-RETURN-ELSE-statement. The display-variable itself is a agregated measure, so I cannot change the format to alphanumerical.

 

The column has to have one format, but the format depends on the value of a parameter.

SASKiwi
PROC Star

It is my understanding that use of SAS formats is "static" in SAS VA. You can change the report display format when building reports but not on the fly when running them.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2988 views
  • 0 likes
  • 3 in conversation