Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

qliklearnervir
New Contributor III

Want to create a master calendar from today to max date

HI,

I want to create a master calendar from today to maxdate as per requirement .Below the code i am using ....but its not showing right week filter ...kindly suggest

LET vToday = Num(Today());

MinMax:

LOAD

  Min([Arrival Date]) as MinDate,

  Max([Arrival Date]) as MaxDate

RESIDENT booking_f;

//Let varMinDate = Num(Peek('MinDate',0,’MinMax’));

//Let varMinDate = Num(Peek($(vToday)));

Let varMaxDate = Num(Peek('MaxDate',0,’MinMax’));

TempCalendar:

Load

$(vToday) + Iterno() -1 as Num,

Date($(vToday) + Iterno() -1) as TempDate

Autogenerate 1 while $(vToday) + Iterno() -1 <= $(varMaxDate);

MasterCalendar:

Load

TempDate As [Arrival Date],

Week(TempDate) As Week,

weekday(TempDate) as WeekDay,

Year(TempDate) As Year,

Month(TempDate) As Month

resident TempCalendar

Order by TempDate ASC;

drop table TempCalendar;

8 Replies
MVP
MVP

Re: Want to create a master calendar from today to max date

Please define your week numbering rules.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
qliklearnervir
New Contributor III

Re: Want to create a master calendar from today to max date

kindly suggest where to define .....

ecolomer
Honored Contributor II

Re: Want to create a master calendar from today to max date

See this example:

MVP
MVP

Re: Want to create a master calendar from today to max date

How about posting it here so we can help you?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
ecolomer
Honored Contributor II

Re: Want to create a master calendar from today to max date

try week(TempDate)

qliklearnervir
New Contributor III

Re: Want to create a master calendar from today to max date

week(TempDate) i have already used.....but not giving me right output

kavita25
Valued Contributor

Re: Want to create a master calendar from today to max date

Hi,

Try the below master calender

let vMinDate = num(MakeDate(2014,04,01));

let vMaxDate = floor(Today());

let vDateToday = num(today());

//************** Temp Calender ******************//

TempCalender:

load

$(vMinDate) + rowno() - 1 as DateNumber,

date($(vMinDate) + RowNo() - 1) as Date

AutoGenerate

$(vMaxDate) - $(vMinDate) + 1;

Master_Calender:

    

load (Date) as Date,

      Date(Date,'DD/MM/YYYY') as DATE,

      Year(Date) as Year,

      Month(Date) as Month,

      day(Date) as Day,

      Week(Date) as Week,

    'Q' & (ceil(WildMatch(month(Date),'Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar')/3)) as Quarter

  

    Resident TempCalender where exists(Date);

   drop table TempCalender;

Hope it helps you!!

qliklearnervir
New Contributor III

Re: Want to create a master calendar from today to max date

Just describing my scenerio.....

I want to filter out the data according to Today's date  till max date.

suppose today is 12th august 2015 and i have data till jan 2016.

so my first week should be week comes in date 12th august and vice versa till jan 2016.

i think my requirement is clear for every one .

kindly suggest