Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

same period for 3 date feild

hi,

i have 3 date feild with 3 different meaning.

i want to make one feild for : year,querter,month for the 3 feild.

how to do it ?

thanks'

yarin.

Labels (1)
4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See this blog post: The Master Calendar

And this discussion


talk is cheap, supply exceeds demand
er_mohit
Master II
Master II

you have to make a master calendar and putting same Name field for date so that, it automatically linked with it

Try this

// Calender

LET vDateMin = Num(MakeDate(2008,1,1));

LET vDateMax = Floor(DayEnd(Today()));

LET vDateToday = Num(Today());

    

TempCalendar:

  LOAD

 

$(vDateMin) + RowNo() - 1 AS DateNumber,

  Date($(vDateMin) + RowNo() - 1) AS TempDate

  AUTOGENERATE 1

  WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);

     Calendar:

  LOAD

  Date(TempDate,'DD-MM-YYYY' ) AS CalendarDate,

      // Standard Date Objects

  Day(TempDate) AS CalendarDayOfMonth,

  WeekDay(TempDate) AS CalendarDayName,

num(WeekDay(Today()))as ppp,

Week(TempDate) AS CalendarWeekOfYear,

  Month(TempDate) AS CalendarMonthName,

  'Q' & Ceil(Month(TempDate)/3) AS CalendarQuarter,

'W' & Ceil(Week(TempDate)/8) as Fiscalweek,

Date(Date#('Mar Week 5','MMM WWW D'),'DD/MM/YYYY') AS Sunday,

Year(TempDate) AS CalendarYear,

   Dual(Year(TempDate) & '-Q' & Ceil(Month(TempDate)/3), Year(TempDate) & Ceil(Month(TempDate)/3)) as YearQtr,

   'FY' & Right( Year(TempDate),2) as YearQtrfy,

    // Calendar Date Names

  WeekName(TempDate) as CalendarWeekNumberAndYear,

  MonthName(TempDate) as CalendarMonthAndYear,

  QuarterName(TempDate) as CalendarQuarterMonthsAndYear,

     // Start Dates

  DayStart(TempDate) as CalendarDayStart,

  WeekStart(TempDate) as CalendarWeekStart,

MonthStart(TempDate) as CalendarMonthStart,

QuarterStart(TempDate) as CalendarQuarterStart,

YearStart(TempDate) as CalendarYearStart,

// End Dates

DayEnd(day(TempDate)) as CalendarDayEnd,

WeekEnd(TempDate) as CalendarWeekEnd,

MonthEnd(TempDate) as CalendarMonthEnd,

QuarterEnd(TempDate) as CalendarQuarterEnd,

// Combo Date Examples

'Q' & Ceil(Month(TempDate)/3) & '/' & Year(TempDate) AS CalendarQuarterAndYear,

Year(TempDate) & '/' & 'Q' & Ceil(Month(TempDate)/3) AS CalendarYearAndQuarter,

'Wed ' & DayStart(WeekStart(TempDate) + 3) as CalendarWednesdays,

'Sun ' & DayStart(WeekStart(TempDate) + 3) as CalendarSunday

RESIDENT TempCalendar ORDER BY TempDate ASC;

DROP TABLE TempCalendar;

tresB
Champion III
Champion III

you can try like this:

Load   DateField1,

          Year(DateField1) as Year1,

          Month(FDateField1) as Month1,

          'Q' & Ceil(Month(DateField1) / 3) as Quarter1

From ....;

Similarly for DateField2 and dateField3,

Load DateField2,

          Year(DateField2) as Year2,

....;    

Not applicable
Author

Dual(Year(Date) & '-Q ' & Ceil(Month(Date)/3) & '-M ' & Month(Date), Year(Date) & Ceil(Month(Date)/3) & Month(Date)) as YearQuarterMonth