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

PANKAJ
PANKAJ Partner, L2 Admin, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 26 Partner

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.

Best Answer

  • PANKAJ
    PANKAJ Partner, L2 Admin, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 26 Partner
    Answer ✓

    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?

Answers

  • fchataigner2
    fchataigner2 Dataiker Posts: 355 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...

Setup Info
    Tags
      Help me…