Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to a create a straight table as follows from 5 fields(FIELD1-FIELD5-).
dim1, calcdim2, expr1, expr2,exp3
dim1 = FIELD1
calcdim2 is a calculated dimension = if(aggr(avg(FIELD3)/sum(FIELD4), FIELD1, FIELD2), 'ABC', 'DEF')
expr1 = sum(aggr(sum(FIELD3 + FIELD4+ FIELD5) , FIELD1, calcdim2))
expr2 = avg(aggr(avg(FIELD5), FIELD1, calcdim2))
expr3 = column(1)/column(2)
The calcdim is calculated with any issues. I am however unable to use calcdim2 in expr1 and expr2.
There is a high probability that the calculation of calcdim2 will change frequently and also many more such dimensions will have to be calculated. Hence I don' t want to push these calculations to the load script.
I Have attached a test qvw.
Could someone help me come up with an elegant solution to this problem?
Regards,
IJK
You could store the calculation in a variable, then call the variable in your expressions.
Hi
Generally you have to include the calculated dimension in full inside the expression to get the result. As suggested in the previous post one way to achieve that is to store the expression in a variable.
You do not want to store the result of the calculation as the the variable is calculated before the chart is built. So the expression should not start with =.
Regards
Jonathan