Forum Discussion

NisaAkkok's avatar
NisaAkkok
New Member
3 years ago

Creating a new table, splitting the 1 column into 2 columns.

I have a table that has a column for

- Name

- Type

- Group (such as group a, group b, group c)

- Value 

 

I want to create a table with all same columns (name, type = Red, Value, expect that i want to split the group column into a new columns so that they are split by group a ( groupa1, groupa2, groupa3) and group b (groupa1, groupa2, groupa3). I also wanna filter by the type, so its only type Red. Which i want to use to plot a line graph with 2 y-axis, group a and group b. 

 

I've attempted however not sure how to complete. Please help. Or if there's any better way to do it. 

 

Household Projections 2 (Total) =
VAR group_a_column 
= FILTER(
                                                  'darts_group_type_population', '

                                                  'darts_group_type_population'[group] IN {

                                                          "groupa2",

                                                          "groupa3",

                                                          "groupa4"

                                                }

                                                && 'darts_group_type_population'[type] = "Red" )

VAR group_b_column = FILTER(

                                                 'darts_group_type_population',

                                                 'darts_group_type_population'[Name] IN {

                                                         "groupb2",

                                                         "groupb3",

                                                         "groupb4"

                                                }

                                                && 'darts_group_type_population'[type] = "Red" )