Announcements
cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## Calculating Percentage

Hi,

I want  to calculate percentage of total sales per customer/total sales for dates which are selected.

Am using the formula

(sum({\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=, CustomerCode>} \$(eSales))

-sum({\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=, CustomerCode>} \$(eRent)))

/

sum({\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=>} \$(eSales))

-sum({\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=>} \$(eRent))

But the result is 100%.

Thanks,

Remya

1 Solution

Accepted Solutions
MVP

Try this

(sum({\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=, CustomerCode>} \$(eSales))

-sum({\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=, CustomerCode>} \$(eRent)))

/

(sum(TOTAL {\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=>} \$(eSales))

-sum(TOTAL {\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=>} \$(eRent)))

2 Replies
MVP

Try this

(sum({\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=, CustomerCode>} \$(eSales))

-sum({\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=, CustomerCode>} \$(eRent)))

/

(sum(TOTAL {\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=>} \$(eSales))

-sum(TOTAL {\$<DateKey={">=\$(=Date(vFromDate,'YYYYMMDD'))<=\$(=Date(vToDate,'YYYYMMDD'))"}, Year=, Quarter=, Month=, WeekName=, Date=>} \$(eRent)))

Anonymous
Not applicable
Author

Thanks

Community Browser