Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am a new learner in qlikview. I am looking for inputs on grouping 4 month data.
For eg.
Jan, Feb, Mar and Apr will group into C1 cycle,
May, Jun, Jul and Aug will group into C2 cycle
Sep, Oct, Nov and Dec will group into C3 cycle
Could you please provide your inputs.
Thanks
Where does your month field come from?
I suggest you use a master calendar and simply create this flag in there. Look at the way the Quarters are created and base it on that
MasterCalendar:
Load
TempDate AS OrderDate,
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
Day(TempDate) As Day,
'Q' & ceil(month(TempDate) / 3) AS Quarter,
'C' & ceil(month(TempDate) / 4) AS Cycle,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear,
WeekDay(TempDate) as WeekDay
;
//=== Generate a temp table of dates ===
LOAD
date(mindate + IterNo()) AS TempDate
,maxdate // Used in InYearToDate() above, but not kept
WHILE mindate + IterNo() <= maxdate;
//=== Get min/max dates from Field ===/
LOAD
min(FieldValue('OrderDate', recno()))-1 as mindate,
max(FieldValue('OrderDate', recno())) as maxdate
AUTOGENERATE FieldValueCount('OrderDate')
Where does your month field come from?
I suggest you use a master calendar and simply create this flag in there. Look at the way the Quarters are created and base it on that
MasterCalendar:
Load
TempDate AS OrderDate,
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
Day(TempDate) As Day,
'Q' & ceil(month(TempDate) / 3) AS Quarter,
'C' & ceil(month(TempDate) / 4) AS Cycle,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear,
WeekDay(TempDate) as WeekDay
;
//=== Generate a temp table of dates ===
LOAD
date(mindate + IterNo()) AS TempDate
,maxdate // Used in InYearToDate() above, but not kept
WHILE mindate + IterNo() <= maxdate;
//=== Get min/max dates from Field ===/
LOAD
min(FieldValue('OrderDate', recno()))-1 as mindate,
max(FieldValue('OrderDate', recno())) as maxdate
AUTOGENERATE FieldValueCount('OrderDate')
Thanks Adam for quick response. Above suggested thing works in my case.