Forum Discussion
Anonymous
9 years agoNot applicable
How to create reusable function
Hello, I would like to create a reusable function and I cannot find a way to do that. Is it even possible? Here is my use-case. I have several columns e.g., "Score A" and "Score B" with scores th...
- Anonymous9 years ago
Eventually I created an M function following the tutorial here.
Anonymous
9 years agoNot applicable
Hi Anonymous,
Without knowing your table/scenario, I suppose that you want is something like that, but it will not work properly:
Qualitative score = if(X[Score A]<10 || X[Score B]<10 || X[Score C]<10 || X[Score D]<10 ,"Poor","Excellent")
... but, if each column have only one Score, I think that the best scenario is unpivot your table like this:
Atribute | Value __________________________________ Score a | 2 Score b | 32 Score c | 21 Score d | 4
and create this column:
Qualitative Score = if(x[Value]<10 ,"Poor","Excellent")
Anonymous
9 years agoNot applicable
Anonymous
Thank youfor the answer. Each score should have its own qualitative value. The unpivot method could work but the columns are calculated columns so I cannot unpivot them since they do nto appear in the Query.