Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Want to calculate Share of products but facing this problem
I Have Been Using This Expression But It Is giving me error because it cant sum up the sales
Sum($(CURR_YTD_SALES))/Sum(Total($(CURR_YTD_SALES)))
So is There a way to sum up sales by using variables to calculate Shares
Thanks In Advance
Gross Sales
if(num(GetSelectedCount(Year_new))=0
or GetFieldSelections(Year_new)='2016' ,
sum({<[DATE_FORMAT.autoCalendar.Month]=,[DATE_FORMAT.autoCalendar.Date]=
{"$(= '>=' & '01-04-'& (Date(monthstart(Today()), 'YYYY')) & '<=' & '30-06-'& (Date(monthstart(Today()), 'YYYY')))"}>}GROSS_SALES_VALUE),
sum({<[DATE_FORMAT.autoCalendar.Month]=,[DATE_FORMAT.autoCalendar.Date]=
{"$(= '>=' & '01-04-'&Date(AddYears(date('01-04-'& GetFieldSelections(Year_new)),+0), 'YYYY') & '<=' & '30-06-'&Date(AddYears(date('30-06-'& GetFieldSelections(Year_new)),+0), 'YYYY'))"}>}GROSS_SALES_VALUE)
)
Similarly for Gross Return
Just try to debug each variable.
according to your expression
It should be
(sum(Gross sales) - sum(Gross return))/(sum(Total Gross sales) - sum(Total Gross return))
it will give you share %
its working this way but i want it dynamic thats why i used variables
but whenever i try to do the sum of a certain variable it fails
eg: in case of above variable
sum($CURR_YTD_SALES)/sum(total($CURR_YTD_SALES))
if i break down the above variable in 2 parts
1.sum($CURR_YTD_SALES)
2.sum(total($CURR_YTD_SALES))
so in both parts i cant sum up the variable
create different variable CURR_YTD_TOTAL_SALES as
if(num(GetSelectedCount(Year_new))=0
or GetFieldSelections(Year_new)='2016' ,
sum(Total {<[DATE_FORMAT.autoCalendar.Month]=,[DATE_FORMAT.autoCalendar.Date]=
{"$(= '>=' & '01-04-'& (Date(monthstart(Today()), 'YYYY')) & '<=' & '30-06-'& (Date(monthstart(Today()), 'YYYY')))"}>}GROSS_SALES_VALUE),
sum(Total {<[DATE_FORMAT.autoCalendar.Month]=,[DATE_FORMAT.autoCalendar.Date]=
{"$(= '>=' & '01-04-'&Date(AddYears(date('01-04-'& GetFieldSelections(Year_new)),+0), 'YYYY') & '<=' & '30-06-'&Date(AddYears(date('30-06-'& GetFieldSelections(Year_new)),+0), 'YYYY'))"}>}GROSS_SALES_VALUE)
)
and then use expression as
$(CURR_YTD_SALES)/$(CURR_YTD_TOTAL_SALES)
Its Working But Its Giving 0.00%
Could You Tell me Why?
Try $(CURR_YTD_SALES) and $(CURR_YTD_TOTAL_SALES) individually and see what values it gives?