Ashni Sedani 2 Posted May 14, 2019 Share Posted May 14, 2019 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 More sharing options...
Gaia Paolini Posted May 15, 2019 Share Posted May 15, 2019 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 More sharing options...
Ashni Sedani 2 Posted May 15, 2019 Author Share Posted May 15, 2019 Works brilliantly, thank you! Only one exception - when I have only one column selected for concatenation, which may well be the case, then all values in that column (across all rows) are concatenated. Any ideas of how to get around this Thanks! Link to comment Share on other sites More sharing options...
Gaia Paolini Posted May 15, 2019 Share Posted May 15, 2019 try adding a null at the end: Concatenate($map("[${selbox}]", ",', ',"),null) Link to comment Share on other sites More sharing options...
Ashni Sedani 2 Posted May 15, 2019 Author Share Posted May 15, 2019 great, thanks so much! all sorted! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now