I am working on a data analysis problem where I have multiple columns of data which are to be analysed pairwise (basically two experiments with different dosages for each compound).
So the dataset structure looks like this
Target|Sample1_high|Sample1_low|…SampleN_high|SampleN_low
As the analysis is to be done by users who conducted the experiment, I used Column Selection Widgets in a Component to allow them to pick the two columns of interest, encoding the selected Column Heads in two flow variables.
The decisive step in the analysis is now a rule-based row filter to check for some criteria to be met for the result to be declared relevant, based on comparison of values within the two columns of interest.
Is there a way to use the values stored in the flow variables earlier as column names in the Rule Engine? This would save me to rewrite the rules everytime a new pair of columns is picked. alternatively, is there a way to address column index (in equivalence to row index) to address the respective columns in a more generic fashion?
Any help would be greatly appreciated.
You simply need to change data structure to
Sample Number, Sample_High, Sample_low
and use regular row filter on Sample number.
You ca use Unpivot node to change structure.
Dear izaychik63,
thank you - that will work obviously and I will pursue this line to get this specific analysis done.
I was also wondering about the possibility in general, to use data stored in flow variables as Column Headers in the Rule Engine.
you can’t use column names stored in flow variables as column names in Rule Engine nodes but there is a workaround!
one option is to use Column Expressions node. There you can access column with following syntax column(0), column(1)… Or like this column(flow_variable) where flow_variable is your column name. Combined with simple if() clause you can get additional column upon which you then filter your data