Fold multiple columns: selection of columns
![UserBird](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar12.png)
UserBird
Dataiker, Alpha Tester Posts: 535 Dataiker
Hi,
I would like to fold a dataset with several columns into one single columns. So I would like to use the built-in function "Fold multiple columns".
The only annoying thing is that I would have 1739 columns to select. It is fairly time-consuming to do this by hand. Would there be any sort of trick to select all the columns, instead of typing each name? I can use a script in R or Python but I was wondering if there was a way to do it in a preparation script.
I tried to select the columns and use the "mass action" but the fold command cannot be found.
Many thanks !
Best regards,
I would like to fold a dataset with several columns into one single columns. So I would like to use the built-in function "Fold multiple columns".
The only annoying thing is that I would have 1739 columns to select. It is fairly time-consuming to do this by hand. Would there be any sort of trick to select all the columns, instead of typing each name? I can use a script in R or Python but I was wondering if there was a way to do it in a preparation script.
I tried to select the columns and use the "mass action" but the fold command cannot be found.
Many thanks !
Best regards,
Tagged:
Best Answer
-
Hi Raphaëlle,
If there is a common pattern of names to the columns that you want to fold, you can use the "Fold multiple columns by pattern" processor, which let you fold all columns matching a regexp.
Note that using a "negative lookahead" regexp, you can also, to some extent, use this processor to "fold all columns except"
Answers
-
What is the proper syntax for this regexp, i.e. fold all columns except?