I have a dataset which has KPIs and corresponding Values as two different columns with field names - kpi and val.
I need to perform summation of few of these KPIs to populate another KPI’s value. For example
kpi val
A 3.2
B 4.5
C 7.2
M 4.6
K 8.2
I need to compute kpi - D as a summation of the kpi A, B and C’s value and append it to the kpi column itself such that it looks like this
kpi val
A 3.2
B 4.5
C 7.2
D 14.9
M 4.6
K 8.2
I tried using calculated field where KPI D’s val is given by -
Name - kpi_d_val
sumif(avg({val}), in({{kpi}, [“A”, “B”, “C”]))
But I am not sure how to create a key value pair such that key is “D” and val is the above computed value. This key value pair further should be appended to the table as shown above.
Further I’ll have a line chart which has A, B, C, D, M, K as X axis and corresponding values as the Y axis.
Can you please help me how to satisfy this requirement?
Also few notes on my attempts -
I had a null value for a KPI with similar name already in the dataset which I tried to populate the value with D’s value like
ifelse({kpi}=“J”, kpi_d_val, avg({val}))
But this keeps giving mismatch aggregation error. I tried a lot of combinations but keep getting this error.