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

HI, 

I want to convert in a String variable the number variable that is result of a difference between two period calculated with function RelativePeriod .

Example: 1 = "positive" ; -1 = "negative" etc

But it's not possible because it is a aggregate calculated. Is there a solution?

 

Then I want to insert a parameter  in the "offset interval" but it accepts only numbers.  Is there a solution?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Sam_SAS
SAS Super FREQ

Hello,

 

I don't think you can make the output of RelativePeriod into a string, sorry.

 

For what it is worth, you can apply display rules to aggregated measure values. So you could highlight the positive/negative differences.

 

A workaround that is sometimes suggested when working with aggregated values is to create an aggregated data source to store the aggregated values.

 

For the offset parameter, I believe you could do something very inelegant like this:

 

IF ( 'Param'p = 1 )
RETURN <RelativePeriod expression with offset 1>
ELSE IF ('Param'p =2 )

RETURN <RelativePeriod expression with offset 2>

ELSE IF ('Param'p =3 )

RETURN <RelativePeriod expression with offset 3>

 

And so on.

 

You could give it a try.

 

Let us know if that helps.

 

Thanks,

Sam

View solution in original post

1 REPLY 1
Sam_SAS
SAS Super FREQ

Hello,

 

I don't think you can make the output of RelativePeriod into a string, sorry.

 

For what it is worth, you can apply display rules to aggregated measure values. So you could highlight the positive/negative differences.

 

A workaround that is sometimes suggested when working with aggregated values is to create an aggregated data source to store the aggregated values.

 

For the offset parameter, I believe you could do something very inelegant like this:

 

IF ( 'Param'p = 1 )
RETURN <RelativePeriod expression with offset 1>
ELSE IF ('Param'p =2 )

RETURN <RelativePeriod expression with offset 2>

ELSE IF ('Param'p =3 )

RETURN <RelativePeriod expression with offset 3>

 

And so on.

 

You could give it a try.

 

Let us know if that helps.

 

Thanks,

Sam

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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