BookmarkSubscribeRSS Feed
tweehh
SAS Employee

Hi VA experts,

 

Is there a way to insert a line break using concatenate operator in SAS VA? For example, I have a table that looks like this:

Issue  Action1 Action2 Action3

 

I want to concatenate those last 3 columns into one column called 'Action'. The Action column should look like below:

Action1

Action2

Action3

 

Thanks for any help you can provide!

 

4 REPLIES 4
Sam_SAS
SAS Employee

Hello,

 

All calculations in the VA expression editor are evaluated at the row level (one row in, one row out) so it should not be possible to output multiple rows in the way you want.

 

I believe one approach to what you want to do would be to use the TRANSPOSE procedure in your data preparation stage. You can get help with that in the SAS Procedures community 

 

Let us know if that helps,

Sam

tweehh
SAS Employee
Just wanted to clarify, I'd like to concatenate Action1,2 and 3 into one row with a line break between them.
Sam_SAS
SAS Employee

If I understand correctly, the request is that the three values are in one table cell, but they will display with linebreaks when you add them to a List Table object? I think this is not possible, sorry.

 

Edit: Actually, it is not that simple. You can use the "\n" escape sequence to specify a newline character, but it appears that this is ignored most of the time. It does appear to be honored in data tips. This is not recommended, I am seeing some buggy behavior with this.

 

I am investigating this with the dev team.

thomasvandriel
Calcite | Level 5

Here is something you can do:

thomasvandriel_0-1713883822427.png

In text: Concatenate(Concatenate('Text'n, ' - '), 'Text'n)

So the idea is to use the concatenate function multiple times.

 

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
  • 4 replies
  • 595 views
  • 0 likes
  • 3 in conversation