Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
stevegimbrollmt
Creator II
Creator II

Weekly Cycle

Hi all

Not sure if there is any interesting method in achieving something like this:

16/09/201323/09/201330/09/201307/10/201314/10/201321/10/201328/10/2013
Call Answered123423422342234234231512716357
Calls Rejected432423422432234232341926921508
Emails42342323422422342234257133773
Web Views4234243223422342234234130507138090

Where I would have a daily record but I need to represent the figures on weekly cycle starting on Mondays for the past 7 weeks.

Any ideas? Do I need to use the Ceil function?

Thanks

Steve

1 Solution

Accepted Solutions
stevegimbrollmt
Creator II
Creator II
Author

I did something simliar but I just created a Week field and worked on that.

Basically did thse 2 steps:


  • =WeekStart(Date) in the Calc Dimension
  • Sum({<WeekField={'<=$(=max(WeekField))>$(=max(WeekField)-6')>}Value) in the expression

Thanks again for your help

View solution in original post

6 Replies
israrkhan
Specialist II
Specialist II

create a week field in load script,

like below

load * ,

week(Date) as Week Num

from .......

and then take pivot table, add [Call Answered Field] to your first dimension and week-number to your second dimension,

and then select and drag up  week number dimension to horizontal.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You want to show only the values of the mondays? In that case you could create a flag field in the script for the mondays:

Load x,y,z,

MyDate,

if(weekday(MyDate)=1,1,0) as IsMonday

from ...

You can then adapt your expression using the new IsMonday field. Count(Value) would become count({<IsMonday={1}>}Value).

If you want to show weekly totals, but show the dates of the mondays you create a field StartOfWeek: weekstart(MyDate) as StartOfWeek. You can then use this field as dimension instead of MyDate.


talk is cheap, supply exceeds demand
stevegimbrollmt
Creator II
Creator II
Author

That would be good for Mondays but as you asked,  the values I need them still to be weekly but sort of the date start of the week would be the Monday as I shown in the sample above.

Thanks a lot for your feedback

Steve

stevegimbrollmt
Creator II
Creator II
Author

I have used  =WeekStart(Date) in the Calculated Dimension and it seems I got what I needed.

All I need to do now is do it for only the last 7 weeks.

Thanks..

Steve

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can limited that in the expression. Something like this:

count({<Date={'>$(=max(Date)-49)<=$(=max(Date))'}>}Value)

Perhaps you'll want to use a weekstart in there too if your max Date isn't a monday.


talk is cheap, supply exceeds demand
stevegimbrollmt
Creator II
Creator II
Author

I did something simliar but I just created a Week field and worked on that.

Basically did thse 2 steps:


  • =WeekStart(Date) in the Calc Dimension
  • Sum({<WeekField={'<=$(=max(WeekField))>$(=max(WeekField)-6')>}Value) in the expression

Thanks again for your help