How to select few columns as a table out of a huge table?

Solved!
PANKAJ
Level 3
How to select few columns as a table out of a huge table?

Suppose I have to select DISTINCT concat(col_1,col_2) as new_col,col_3,col_4,col_5 only as a new table from a table having more than 100 columns.

My method: In the prepare recipe make a new column using the Concat function, then in another step move those 4 columns to keep them in order as mentioned above.

But, then I have to delete all remaining columns manually to get the desired output in a new table, which is a tedious process.

then I will pass my table through the distinct recipe to get my final desired result.

can anyone help me with a better approach than this, especially with that delete step?

 

Note: I'm not allowed to use any code recipe.

 

0 Kudos
1 Solution
PANKAJ
Level 3
Author

I found one. Instead of delete columns, I can keep(only) columns. Since I've 4 columns it worked. But, what if there are a large number of columns to keep?

View solution in original post

2 Replies
PANKAJ
Level 3
Author

I found one. Instead of delete columns, I can keep(only) columns. Since I've 4 columns it worked. But, what if there are a large number of columns to keep?

fchataigner2
Dataiker

Hi,

sadly there's no magic here. The "Delete/Keep" column step can let you choose multiple columns by giving an explicit list, of by giving a regular expression to filter column names, and that's about it...

0 Kudos