Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Create new table with custom column name

Hey guys,

I feel this is a very basic question. 

So I have this expression which creates a new table and which works fine:

Helper Summary Table = 
{
    (
        SELECTCOLUMNS(TOPN(1, r_fs, r_fs[date_created], DESC), "country_value", [country_1_value]),
        SELECTCOLUMNS(TOPN(1, r_fs, r_fs[date_created], DESC), "country_name", [country_1_name]) 
    ),
    (
        SELECTCOLUMNS(TOPN(1, r_fs, r_fs[date_created], DESC), "country_value", [country_2_value]),
        SELECTCOLUMNS(TOPN(1, r_fs, r_fs[date_created], DESC), "country_name", [country_2_name]) 
    ),
}


The resulting output is a table with the right format - i.e. two columns "Value1" and "Value2" with two data rows. 

How can I rename the "Value1" and "Value2" fields to a custom name?

  • Anonymous's avatar
    Anonymous
    6 years ago

    ...

    Alright - I just renamed the columns via the "Fields" tab. Previously, I looked into a programmatically solution.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    ...

    Alright - I just renamed the columns via the "Fields" tab. Previously, I looked into a programmatically solution.