Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
bibopipo
Contributor II

Calendar problem

Dear all,

how can I create a calendar having the year values only ?

For example:

periodo between  2010  and 2012

Is is possible without a range date ?

Thanks in advance

1 Solution

Accepted Solutions

Re: Calendar problem

HI

Ya , its give.. For additional information..

Try like this

Let vEnd = Num(Today(1));

Let vStart = Num(YearStart($(vEnd),-4)) - 1;

Generate:

LOAD Date($(vStart) + IterNo()) AS Date , num((rand() * 100) + 1000, '##0') as Sales

AutoGenerate 1

While ($(vStart) + IterNo()) <= $(vEnd);

Tablename:

LOAD Month(Date)*1 AS MonthKey1, Month(Date) as Month,Year(Date) AS Year,Day(Date) AS Day,Num(Date) as DateNUm ,

Dual('Q' & Ceil(Month(Date) / 3) & ' ' & Year(Date), QuarterName(Date)) as Quarter,

MonthName(Date) as Monthyear

Resident Generate;

Hope that helps..

4 Replies

Re: Calendar problem

Hi

I think , if i understand your requirement, r u looking like this?

Load

Year(DateField) as Year,

Sales

From TableName;

Its load year and sales value only..without load the date field.

bibopipo
Contributor II

Re: Calendar problem

Yes, but I solved maybe.

I created the calendar by the makedate function: makedate(firstyear, 01,01) as mindate and makedate(lastyear,12,31) as maxdate. It should be correct, I hope...

Thanks for your attention

stefan

Re: Calendar problem

HI

Ya , its give.. For additional information..

Try like this

Let vEnd = Num(Today(1));

Let vStart = Num(YearStart($(vEnd),-4)) - 1;

Generate:

LOAD Date($(vStart) + IterNo()) AS Date , num((rand() * 100) + 1000, '##0') as Sales

AutoGenerate 1

While ($(vStart) + IterNo()) <= $(vEnd);

Tablename:

LOAD Month(Date)*1 AS MonthKey1, Month(Date) as Month,Year(Date) AS Year,Day(Date) AS Day,Num(Date) as DateNUm ,

Dual('Q' & Ceil(Month(Date) / 3) & ' ' & Year(Date), QuarterName(Date)) as Quarter,

MonthName(Date) as Monthyear

Resident Generate;

Hope that helps..

bibopipo
Contributor II

Re: Calendar problem

Thanks, really much more complete.

Community Browser