Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have one scenario:
load * Inline
[
year,month,visits
2007,1,20
2007,2,30
2009,1,30
]
I want to calculate the pecentage, it looks like this:
Year Month Visits Percentage
2007 1 20 20/50
2007 1 30 30/50
2009 1 30 30/ 30
It means how many percentage the month visits occupied based on the same year.
I want to use pivot table to achieve, how to write this expression?
Thanks.
Hello Isaac,
Create a new chart, pivot table, set year and month (in that order) as dimensions.
Use the following expression:
Sum(visits) / Sum(TOTAL <year> visits)
In the "Number" tab, set it to %
Hope that helps.
If I understood correctly how you want to display your ratio/percentage, this should help.
just calculate the number of visits by year in the script, you will be able to do calculations very easily :
load
year, sum(visits) as visitsByYear resident yourTable group by year;
Hello Isaac,
Create a new chart, pivot table, set year and month (in that order) as dimensions.
Use the following expression:
Sum(visits) / Sum(TOTAL <year> visits)
In the "Number" tab, set it to %
Hope that helps.
Could you paste the code directly, because I just have named cal. thantks
sum(visits) & '/' & sum(total <year> visits)
try this:
=Sum(visits)/Sum(total <year> visits)
Hope this helps.
regards, tresesco
Thanks,it works. But I want to know the meaning of it.
I know total means get the whole visits. But what's the meaning of <year> ?
<year> says about the totaling dimension. means get the whole visits...YEARLY.
So all the dimension can be used after total, right?
It means <Dim> is a part of total, right?
Sorry, and total <year> is not a set analysis, do I understand right?
Sorry to disturb you again.