Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
=if(I_DAY >= 0 and I_DAY <=15, dual('1-15 Days',1),
if(I_DAY >= 16 and I_DAY <= 25,dual('16-25 Days',2),
if(I_DAY > 25, dual('> 25 Days',3))))
I have above calculated dimension in my pivot table and the resulting out put is as follows
Month | 1-15 Days | 16-25 Days | > 25 Days | Total |
Jan | 25,000 | 40,000 | 50,000 | 115,000 |
Feb | 75,000 | 150,000 | 250,000 | 475,000 |
Mar | 60,000 | 250,000 | 35,000 | 345,000 |
Total | 160,000 | 440,000 | 335,000 | 935,000 |
But I want to insert the percentages to this pivot table to look it like as follows
Month | 1-15 Days | % | 16-25 Days | % | > 25 Days | % | Total |
Jan | 25,000 | 22 | 40,000 | 35 | 50,000 | 43 | 115,000 |
Feb | 75,000 | 16 | 150,000 | 32 | 250,000 | 53 | 475,000 |
Mar | 60,000 | 17 | 250,000 | 72 | 35,000 | 10 | 345,000 |
Total | 160,000 | 17 | 440,000 | 47 | 335,000 | 36 | 935,000 |
Pls help me to write expression to show the % values
If you perform you calculation in the script:
if(I_DAY >= 0 and I_DAY <=15, dual('1-15 Days',1),
if(I_DAY >= 16 and I_DAY <= 25,dual('16-25 Days',2),
if(I_DAY > 25, dual('> 25 Days',3)))) as DelayClass
then you can calculate the percentages as
Sum(Amount) / Sum(total <Month> Amount)
HIC
In fact, you can do the same also with a calculated dimension... Just create a second expression using
Sum(Amount) / Sum(total <Month> Amount)
HIC
You can use another Expression as Labeled '%' and expression as Heneric suggested.
Thanks Henric
But when I add your code to script I get a following message when relaoding
Script Line error
if(I_DAY >= 0 and I_DAY <=15, dual('1-15 Days',1),
Pls help to rectify
Well, you need to give more information than just "Script Line error"... I don't know what your script looks like.
HIC
You could try Sum(Amount) / Sum(total <Month> Amount) to get percentage.