Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a below table and I would like to calculate percentages for my dimesions. The problem is, I have amounts in both Positive and negatives and I need to use Fabs() to get them into positive at dimension level summarization.
Ex:
Field1, Amount
aaa, -200
aaa, 50
bbb, 300
bbb, -100
Expected results to calculate percentage by using Bar Chart:
aaa, 42.5% (150/350)
bbb, 57.1% (200/350)
Thanks in advance.
Dim Field1
Expression fabs(sum(Amount)) / sum(total fabs(aggr((sum(Amount)), Field1)))
Please check enclosed file..
Create a Bar Chart...
Dimension = Field1
Expression : FABS(SUM(Amount)/SUM(TOTAL{<Amount = {'>0'}>}Amount))
UPDATE :
Go to Number Tab and Tick Show in Percentage
Dim Field1
Expression fabs(sum(Amount)) / sum(total fabs(aggr((sum(Amount)), Field1)))
HI,
Dimension Field1,
fabs(sum(Amount)/sum(TOTAL {<Amount={">=0"}>}Amount)*100))
Hi Manish,
Thanks for your reply. Probably, my example isnot clear i guess. You have used a conditon with Amount is > 0 in your SET expression. That is NOT I am looking for.
Take a look at another example:
Field1, Amount,
aaa, -200
aaa, 100
bbb, 300
bbb,-100
Expected:
aaa as 33.3% (100/300)
bbb as 66.6% (200/300)
Thanks in advance.
Thanks Grossi.