Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have a measure
sum(if(assetclass = 'A', Amount/oustandingAmount))
Desired output: for asset class A this should get calculated: (sum(Amount/ sum(OustandingAmount)))*100
I tried this: sum(if(assetclass = 'A', sum(Amount/sum(oustandingAmount)))*100) Nested sum is not allowed in measures.
Can you suggest any alternative?
Thank you!
Hi @sunny_talwar, you're right as always:
Sum({<assetclass={'A'}>} Amount)/sum({<assetclass={'A'}>} oustandingAmount)*100
Or maybe you are looking for:
Sum({<assetclass={'A'}>} Amount)/sum(TOTAL {<assetclass={'A'}>} oustandingAmount)*100
Best regards 😊
Hi, using an if inside a Sum gives worst performance than using set analysis. also using set analysis you don't need the first if and the expression can be:
Sum({<assetclass={'A'}>} Amount)/sum(<assetclass={'A'}>} oustandingAmount)*100
Or maybe you are looking for:
Sum({<assetclass={'A'}>} Amount)/sum(TOTAL <assetclass={'A'}>} oustandingAmount)*100
@rubenmarin you missed opening { in the denominator expressions of both of your expressions above
Hi @sunny_talwar, you're right as always:
Sum({<assetclass={'A'}>} Amount)/sum({<assetclass={'A'}>} oustandingAmount)*100
Or maybe you are looking for:
Sum({<assetclass={'A'}>} Amount)/sum(TOTAL {<assetclass={'A'}>} oustandingAmount)*100
Best regards 😊
@rubenmarin Thanks a lot!! it worked! 🙂