Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
rohitk1609
Master
Master

Week over Week comparison with weekstart date dimension in table

Hi Techies,

I have a use case where I need to create table chart in which week over week comparison is happening.

 Suppose I have two columns in my table:

FiscalStartWeeek, Sales, WeekNO

1/2/2017                 10           1

1/9/2017                 24           2

1/16/2017              50           3

1/23/2017              23           4

..

..

..

6/3/2019                24          23

6/10/2019             34          24

 

and I want week over week result as as

 

FiscalStartWeeek, Sales, WoW%

1/2/2017                 10           -

1/9/2017                 24           24/10

1/16/2017              50           50/24

1/23/2017              23           23/50

 

...

..

6/3/2019                24           34/24

 

I have to keep firscalweekstart date in table

 

Thanks,

Rohit

 

 

 

 

 

Labels (2)
9 Replies
sunny_talwar

You can use Above() function or you can do some script work ahead of time by using The As Of Table 

rohitk1609
Master
Master
Author

Hi Sunny,

Thanks for your response, I read many your replies for same problem but couldn't achieve the solution.

If I use above in front end table and select one week from week dimension, the measure results become null becuase above() return 0.

Secondly, I created a asofweek table as:
Load
*
inline
[
AsofWeek WeekNo
1 1
2 1
2 2
3 1
3 2
3 3
..
..
];
and mapped WeekNo which result me lets say for week 24

AsOfWeek WeekNo Sum(Sales)
24 1 10
24 2 15
24 3 8
..
..
24 23 15
24 24 20

but I could achieve how to do 20/15 for 24th Week ?

Can you please help me to achieve it ?

Thanks,
Rohit
sunny_talwar

I am not sure I am able to understand... can you share a sample where I can see the issue

rohitk1609
Master
Master
Author

Dear sunny,
I read your response on few ticket and found that we need to use AsOfWeekNo inline table to achieve
Week over week comparison.
Table chart must has date dimension and one other dimension for which we are calculating weekly growth.

I have made a sample qvw so you can help me to to calculate WOW.

I have created one AsofWeekNo, not sure it is required ,if yes the way I created is right, Please have a look and help me to achieve it.

Thanks,
Rohit

sunny_talwar

Check attached

 

rohitk1609
Master
Master
Author

Thanks for prompt response. 

You are almost there , but only one thing is pending, I need to add date field in the chart you created, is it possible ? this is the point for which I created this ticket.

I am attaching updated qvw for you. Please use thing one.

 

Thanks,

Rohit

sunny_talwar

There are two charts in the attached app, which one are we looking at? Also, what is the output you are hoping to see from the sample provided? Can you provide this output in an Excel format?

rohitk1609
Master
Master
Author

Hi Sunny,

 

iI am attaching the sheet which has expected output. I am talking about the right one table which has comparison field and Asofweek field used. 

 

I just need to bring date field into table corresponding to AsOfWeek . Kindly consider for more than 2 years i.e. 3 years. Sample data is only for 4 weeks.

 

Thanks,

Rohit 

sunny_talwar

Okay that make sense. I think you needed an AsOfDate to go with your AsOfWeek field... This is as if you need a whole AsOf Calendar based on your AsOfDatefield. New Data model

image.png

and this is the chart that you wanted

image.png