Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good afternoon, I am looking for a way to perform an operation of the current week / previous week of the same year
But I only get 0s out.
I leave an image of the structure of my table
I need to create an indicator that divides the sales of the week / week-1 of the same year.
Example: w2/w1,
w3/w2,
w4/w3. ......
etc..
Someone can help me please.
One way would be to use
two ways 1) Create the weeks in Master Calendar and expression to achieve this.
2) create variable and expression.
i'll cover #2 because i don't know how your calendar is structured.
vWeekStart "= WeekStart(today(),0,0)" //var today's current week start date(Monday)
vWeekEnd "= WeekEnd(today(),0,0)" //var today's current week end date (Sunday)
vPrevWeekStart "= WeekStart(today(),-1,0)" //var last week's date on Monday
vPrevWeekEnd "= WeekEnd(today(),-1,0)" //var last week's date on Sunday
expression:
=sum({<date={'>=$(vWeekStart)<=$(vWeekEnd)'}>}amount) //sum current week amount
=sum({<date={'>=$(vPrevWeekStart)<=$(vPrevWeekEnd)'}>}amount) //sum previous week amount
current / previous week.
=(sum({<date={'>=$(vWeekStart)<=$(vWeekEnd)'}>}amount))
/
(sum({<date={'>=$(vPrevWeekStart)<=$(vPrevWeekEnd)'}>}amount)) //current week / previous week
hope this was what you're looking for.
Bon.
Considering the view you have and you just want to take the previous week something like the below
Sum(Sales)/Before( Sum(Sales))
Hello Susant, try with before but only show me "-". Need a division from previous week / week (week / week-1)
hi,
Weeks I have numerics although I concatene the "w" I need week / week-1
Can you post a sample file or the expression you are using ?
its not working i used count instead of sum and and instead of amount i used no.of.sales
can you please help me how to find the current week and previous week count of sales