Dear Cummunity,
Below, I'm using several variables brought by a Dialog:
- colSelect: the column to be analyzed
- quantVal1 & quantVal2: Quantile values
In the following piece of script, I'm creating a "Categories" column, that will then be tabulated to obtain amounts for each quantile.
Two problems:
- replacing the hardcodedl column name with an Eval() method does not work
- how could I test if the column already exists, and if yes, update its formula?
This would allow to refresh my whole analysis process with new column and quantiles, with out having to restart from scratch loading and processing the data table.
//Custom Quantiles amounts
dt << New Column( "Categories",
Numeric, "Continuous",
Format( "Best", 9 ),
Formula(
If( Eval( colSelect )/*:Total Time From CheckIn Collector To Exit*/ <= quantVal1,
1,
If( Eval( colSelect )/*:Total Time From CheckIn Collector To Exit*/ <= quantVal2,
2,
3
)
)
),
Set Property( "Value Order", {} ),
Set Property(
"Color Gradient",
{{"Green to Orange to Red", 4099, {{0, 227, 0}, {255, 255, 0}, {252, 11, 11}}, {0, 0.5, 1}}, Range( {1, 3, 1} )}
),
Color Cell by Value,
Set Display Width( 74 )
);Thanks!