Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Week number

Good afternoon

I'm doing a data classification and I have to compare the sales of the current week and the sales of the previous week, but when doing the classification the system only brings me the current week that is the 35th week. I would like to know if there is a formula in which can bring me the week before, now this is the formula that you make in the Set Analysis

Sum ({<business_line - = {'00'}, Canal_Distri = {'WAREHOUSE SALE'}, year = {$ (= year (today (0)))}, month = {$ (= month (today (0) ))}>} amount)

thanks for your help

4 Replies
neelamsaroha157
Specialist II
Specialist II

The formula that you have should return the sales of the current month (not sure how you are getting the only 1 week sales).

Current:

Sum ({<business_line - = {'00'}, Canal_Distri = {'WAREHOUSE SALE'},year={$(=year(today()))} Week={$(=week(today()))} amount)


Previous:

Sum ({<business_line - = {'00'}, Canal_Distri = {'WAREHOUSE SALE'},year={$(=year(today()))}, Week={$(=Week (today ())-1)} amount)



P.S. - Assuming that you have week field in your data model.

adityaakshaya
Creator III
Creator III

Hi Alvaro,

Create a Field Week in your data with Week(<Your Date Field>)

and add below text in your epression. This will give you previous week Sum of Sales.

Sum ({<business_line - = {'00'}, Canal_Distri = {'WAREHOUSE SALE'}, year = {$ (= year (today (0)))}, month = {$ (= month (today (0) ))}, Week = {$ (= Week (today (0))-1)}>} amount)

Hope this is what you are looking for.

Regards,

Akshaya

Anonymous
Not applicable
Author

Good afternoon

thanks for your help, I have solved the problem, I make the mesh the calculation of the weeks of the year 2018 and then in the analysis set I make the formula.


Sum ({<business_line - = {'00'}, Canal_Distri = {'WAREHOUSE SALE'}, year = {$ (= year (today (0)))}, Week = {$ (= Week (today (0))-1)}>} amount)

thanks.

neelamsaroha157
Specialist II
Specialist II

Glad its worked out. Can you please close the thread now. Thanks