Forum Discussion
Creating new table from existing data
- 7 years ago
mrothschild Please follow the below steps:
1. Create a New Table as below (This will generate the sequence numbers from 0 till the maximum number available on the Duration field in source table. In this case it is 12)
Test215Series = VAR _MaxVal = MAX(Test215MultiRowSplit[Duration]) RETURN GENERATESERIES(0,_MaxVal)
2a. Then Create a New Table as below (Which will give a cartesian product of source table and the series table that was created above)
Test215Out = CROSSJOIN(Test215MultiRowSplit,Test215Series)
2b. Now, will remove the unnecessary records that are not required by flagging. Note I've renamed the Value field to Period field as requied. Add a new column as below
RemoveFlag = IF(Test215Out[Period]<=Test215Out[Duration],"Y","N")
2c. Filter only RemoveFlag = "Y" which are our expected records and then add a new column as below.
Month = EDATE(Test215Out[StartDate],Test215Out[Period])
Final Result
mrothschild Please follow the below steps:
1. Create a New Table as below (This will generate the sequence numbers from 0 till the maximum number available on the Duration field in source table. In this case it is 12)
Test215Series = VAR _MaxVal = MAX(Test215MultiRowSplit[Duration]) RETURN GENERATESERIES(0,_MaxVal)
2a. Then Create a New Table as below (Which will give a cartesian product of source table and the series table that was created above)
Test215Out = CROSSJOIN(Test215MultiRowSplit,Test215Series)
2b. Now, will remove the unnecessary records that are not required by flagging. Note I've renamed the Value field to Period field as requied. Add a new column as below
RemoveFlag = IF(Test215Out[Period]<=Test215Out[Duration],"Y","N")
2c. Filter only RemoveFlag = "Y" which are our expected records and then add a new column as below.
Month = EDATE(Test215Out[StartDate],Test215Out[Period])
Final Result
Perfect, thank you. One question on the filtering in the data, I appreciate the output display, but this is the first time I've seen it used in BI (I've only been programming for a few weeks, so not surprised I haven't seen it before). Does filtering impact display only or does it actually prevent use of data that's filtered to not be visible?
- PattemManohar7 years agoCommunity Champion
mrothschild I've kept that filter to make the steps clear, but the data will be there behind the scenes. Once you reached this step, You can create another final output table with subset of data where RemoveFlag = Y. This final table can be used further in your visuals or further calculations.