Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to derive the quarters like
Jan,Nov,Dec-Q1,Feb,Mar,Apr-Q2,May,June,July-Q3,Aug,Sep,Oct-Q4 and every quarter have 13 weeks
like week numbers Q1-1to 13 ,Q2-1 TO 13
You can change your environment variable of monthstart
HI, maybe you could use this for Quarter?
'Q'&Pick(Num(Month(DateField)),1,2,2,2,3,3,3,4,4,4,1,1)
Hello Ashok,
Use below for week derivation
if(num(Right (WeekName(Today()),2)) <=13,'Q1',
if(num(Right (WeekName(Today()),2)) > 13 and num(Right (WeekName(Today()),2)) <=26,'Q2',
if(num(Right (WeekName(Today()),2)) > 26 and num(Right (WeekName(Today()),2)) <=39,'Q3',
if(num(Right (WeekName(Today()),2)) > 39 and num(Right (WeekName(Today()),2)) <=52,'Q4'
))))
Hi,
Please try this one:
Let vMinDate = Num(Today());
Let vRows = 368;
Dates:
Load
DateField,
'Q' & Pick(Num(Month(DateField)),1,2,2,2,3,3,3,4,4,4,1,1) As Quarter,
'W' & Ceil(RangeMax((DateField - MakeDate(Num(Year(DateField))-If(Num(Month(DateField))=1,1,0),Pick(Num(Month(DateField)),11,2,2,2,5,5,5,8,8,8,11,11),1))/7,1)) as WeekNumber;
Load
Date($(vMinDate) - $(vRows) + IterNo()) as DateField
AutoGenerate 1 While IterNo() <= $(vRows);
Hi Ashok,
Just curious to see how did you go.
Remember to close it when you're done (Correct / Helpful)
Qlik Community Tip: Marking Replies as Correct or Helpful
Cheers,
Luis
Hi,
Just wondering to know how you went about this one,
Cheers,
Luis
PS. When applicable please mark the appropriate replies as Correct. This will help community members know which discussions have already been addressed and have a possible known solution. Please mark replies as Helpful if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as Helpful if you feel additional info is useful to others