Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating a Calendar

Hi All,

(I am using Qlikview10(unlicensed).

I need to create a calendar which should contain year, period, month, week, startdate, Enddate. I have managed to create Year, Month, Week, Day individually.

But How can I create a period or month. I have used this query.

Calendar:

LOAD

date(yearstart(Date),'YYYY') as Year,

date(monthstart(Date),'MMM YY') as Month,

weekday(Date) as WeekDay,

day(Date) as Day;

LOAD date(recno()+date#('20021231','YYYYMMDD')) as Date

AUTOGENERATE today()-date#('20021231','YYYYMMDD')

Please find attached of the excel-sheet. In this excel sheet you can see there is year, week, startdate and enddate. Can I able to create month and period from this.

Please suggest.

15 Replies
Not applicable
Author

Hello Anand,

It worked.

I did not understand the logic of   Q' & ceil(month(Date) / 3)   AS Quarter .

Please explain.

Thanks.

Not applicable
Author

Hi,

Can you please explain me why you have used

inyeartodate(TempDate, $(vToday),0)*-1                     AS CurYTDFlag,

inyeartodate(TempDate,$(vToday),-1) * -1           AS LastYTDFlag

Thanks.

its_anandrjs

Hi,

Thanks, I explain you In a year we have 4 quarters so when we us month(Date) / 3  it divides into 4 parts but there is no Q word so we just concatedate it by this

Q' & ceil(month(Date) / 3)   AS Quarter

Rgds

Anand

Anonymous
Not applicable
Author

CurYTDFlag creates a flag (1) that indicates if it is the current year.

LastYTDFlag creates a flag (1) that indicates if it is the previous year.

Select the fields Year, CurYTDFlag and LastYTDFlag to see how it works.

These flags can be used in many ways, for example in expressions like:

     Sum({<CurYTDFlag={1}>} Sales)                //Returns only the Sum of the Sales of the current year

     Sum({<LastYTDFlag={1}>} Sales)               //Returns only the Sum of the Sales of the previous year

Hope it's helpfull.

Dennis.

Not applicable
Author

Thanks Anand..

I understood the logic...

Not applicable
Author

Yeah.. I got you..

Thanks,

Sandeepa