Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Week number formatting.

hi all,

I have a data of 2013, 2014 and 2015. and i need to select the data of last 4 weeks and display in bar graph using Qlik sense.

PFA how data resembles in my db.

I used variables like below,

LET vMaxDate= '=max(date_created)';

LET vMaxWeek= '=max(week_number)';

LET vFirstOfLast7 = '=max(date_created,6)';

LET vFourWeeksAgo = '=max(week_number)-3';

The problem is the week number is till only 52. what i needed is, for 2013 it has to produce week_number till 52 and for 2014 it has to start from 53. same for 2015 it has to start from the week_number where 2014 ends,

To produce the week_number i am using the date_created column in table which has the dates in format  dd-mm-yyyy hh-mm-ss.

Anyone please help this to sort out  and to get the data of last 4 weeks.



3 Replies

Re: Week number formatting.

Please post in the Qlik Sense forum.


Re: Week number formatting.

If you want last 4 weeks data, don't use the week numbers in your calculation. Use dates instead in the calculation, the date four weeks ago is date_created-27.

Not applicable

Re: Week number formatting.

Yes I used it. If I use “date_created-27”, it shows data in daily basis. But I need that in week basis.

I think you understand the scenario.

Community Browser