Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Master calendar

hI,

I am having one date coloum.If i select startdate and enddate means, the data's should be display inbetween that startdate and and date...How to use master calendar for that?..

4 Replies
Not applicable

Master calendar

Hi,

should it be automatically?

Otherwise you can select by holding STRG the start and enddate in your Mastercalender and so you have all the dates between.

Regards

vicky

salto
Valued Contributor II

Master calendar

You need to make a relationship between your maste calendar table and your data table:

- A field in the maste calendar named, for example, DateID

- Another field in your data table named DatedID as well (both fields need to have the same name)

Qlikview will make a relation between both fields and the data will be automatically displayed.

Something like this:

//Calendar table

Let StartDate = num(date(YearStart(AddMonths(Today(),-48,0)),'YYYYMMDD'));

Let EndDate = num(date(YearEnd(AddMonths(Today(),0,0)),'YYYYMMDD'));

Calendar:

Load *,

Year(Date) AS [Year],

Month(Date) AS [Month];

Load Date($(StartDate)+(Iterno()-1),'YYYYMMDD') as Date,

Date($(StartDate)+(Iterno()-1),'YYYYMMDD') as DateID,

Autogenerate 1 While Date($(StartDate)+(Iterno()-1)) <=Date($(EndDate)) ;

/Data table

Data:

Load (...)

Date(datefield) as DateID;

(...)

dvqlikview
Honored Contributor II

Re: Master calendar

Hi,

I am attaching a QV document which demonstrates the use of master calendar.

Cheers - DV

Not applicable

Re: Master calendar

I notice you did not do a YTD and MTD field. How would I go about doing that?