Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
Could someone pls help me in getting this scenario. I have 20 products in Product Field where i want to get the avg sales of this week and last week by each product in a chart.
Thnx,
John
Current Week
Avg(Aggr(SUM({<InvoiceYear = , InvoiceQuarter = , InvoiceMonth =, InvoiceWeek = , InvoiceDate = {">=$(=Date(WeekStart(Today())))<=$(=Date(WeekEnd(Today())))"}>}Sales),Product))
or
Simply
Avg(SUM({<InvoiceYear = , InvoiceQuarter = , InvoiceMonth =, InvoiceWeek = , InvoiceDate = {">=$(=Date(WeekStart(Today())))<=$(=Date(WeekEnd(Today())))"}>}Sales))
Last Week
Avg(Aggr(SUM({<InvoiceYear = , InvoiceQuarter = , InvoiceMonth =, InvoiceWeek = , InvoiceDate = {">=$(=Date(WeekStart(Today()-7)))<=$(=Date(WeekEnd(Today()-7)))"}>}Sales),Product))
or
Simply
Avg(SUM({<InvoiceYear = , InvoiceQuarter = , InvoiceMonth =, InvoiceWeek = , InvoiceDate = {">=$(=Date(WeekStart(Today()-7)))<=$(=Date(WeekEnd(Today()-7)))"}>}Sales))
Current Week
Avg(Aggr(SUM({<InvoiceYear = , InvoiceQuarter = , InvoiceMonth =, InvoiceWeek = , InvoiceDate = {">=$(=Date(WeekStart(Today())))<=$(=Date(WeekEnd(Today())))"}>}Sales),Product))
or
Simply
Avg(SUM({<InvoiceYear = , InvoiceQuarter = , InvoiceMonth =, InvoiceWeek = , InvoiceDate = {">=$(=Date(WeekStart(Today())))<=$(=Date(WeekEnd(Today())))"}>}Sales))
Last Week
Avg(Aggr(SUM({<InvoiceYear = , InvoiceQuarter = , InvoiceMonth =, InvoiceWeek = , InvoiceDate = {">=$(=Date(WeekStart(Today()-7)))<=$(=Date(WeekEnd(Today()-7)))"}>}Sales),Product))
or
Simply
Avg(SUM({<InvoiceYear = , InvoiceQuarter = , InvoiceMonth =, InvoiceWeek = , InvoiceDate = {">=$(=Date(WeekStart(Today()-7)))<=$(=Date(WeekEnd(Today()-7)))"}>}Sales))
Try like this:
Dimension: Product
Expression: current week:
if(week(your_date_column)=week(today()) ,avg(sales))
previous week:
if(week(your_date_column)=week(today())-1 ,avg(sales))
this should solve the problem
Manish solution should work with what you are asking for
Sorry Guys, I missed few points here the data is not being reloaded every day...its like every three days ..usually every monday & Thursday. So how do we go in this situation
Thnx,
John
Doesn't matter how frequently your data is being loaded. That will not make change on This week or last week.
Thanks Manish
Thnx,
John