Jump to content
We've recently updated our Privacy Statement, available here. ×

Concatenate Dynamic Columns


Ashni Sedani 2

Recommended Posts

Hi all,

I'd like for the user of an analysis dashboard to be able to select a series of columns using a multiple-select list box, and for a calculated column to concatenate the values in the selected columns. I can do the first part in terms of setting up the document property, but am having trouble then using a string list to define the series of columns that need concatenating..

E.g. In a text area, the user would select a series of columns of the data table below, which gets stored as a String List property called 'column_list'.

If the user selects Column_1, Column_3 and Column_4, ${column_list} = 'Column_1,Column_3,Column_4'

 

 

 

Column_1

Column_2

Column_3

Column_4

 

 

Val_1

Val_2

Val_3

Val_4

 

 

 

I would then like a new column, [concat_values] to be calculated by concatenating the values in the selected columns, separated by ",".

In this case, the result would be 'Val_1,Val_3,Val_4'.

 

Is anybody able to advise on how to do this Or if there is an easier way

Thanks

Link to comment
Share on other sites

I think this will work:

Concatenate($map("[${selbox}]", ",', ',"))

where ${selbox} is your string list property.

The $map uses a separator",', '," containing an extra comma,that fools Concatenate into thinking it is an extra string to concatenate, otherwise you don't get the comma between Val_1, Val_2 but Val_1Val_2 instead. You can adjust the space after the comma.

Gaia

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...