Custom new formula columns based on N dynamically stacked data tables
Jul 8, 2018 5:44 PM(988 views)
From a main dataset I create N stacked data tables based on N different parameter types and store them under stkdata.
With each stacked data table I want to create a different new column() formula which would be tailored to the unique length and/or nature of how the fields are delimited. Then I will graph each stacked data set & make reference to data from the new column(s). Currently the graphs are set up making reference to :Data & :Label.
I can get the same formula to be applied across data tables just fine & graph them.
I can't quite figure out how to properly structure the if else scenario or narrow down tools that would be most appropriate (Regex, Pat Match or other).
If( N Items( found_list ) > 0,
//dt << group columns( one_group, found_list );
stkdata = dt << Stack(
columns( As List( found_list ) ),
Keep( :reference_param_one, :reference_param_two),
Output Table( "Stacked " || one_group ),
); // close stacking of columns
colreference = Column( "Label" );
stkdata = Current Data Table();
Pat Match( colreference, "param_group_one" ),
stkdata << New Column( "Limit_one",
Formula( Num( Word( 2, Word( 27, :Label, ":" ), "=" ) ) )
Pat Match( colreference, "param_group_two" ),
stkdata << New Column( "Limit_two",
Formula( Num( Word( 2, Word( 75, :Label, ":" ), "=" ) ) )
Pat Match( colreference, "param_group_three" ),
stkdata << New Column( "Limit_three",
Formula( Num( Word( 2, Word( 29, :Label, ":" ), "=" ) ) )
stkdata << Oneway( Y( :Data ), X( :Label ) )
); // close If N Items (found_list) > 0