Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

hi

i have a date column and want to extract quarter information from this. The date is is the YYYYMMDD format.

thanks

12 Replies
tresesco
MVP
MVP

Try like:

     Load

              'Q' & Ceil(Month(Date#(YourDateField, 'YYYYMMDD'))/3) as Quarter

MK_QSL
MVP
MVP

Create below line in your master calendar or below the Date field...

'Q'&Ceil(Month(Date#(YourDateField,'YYYYMMDD'))/3) as Quarter

Not applicable
Author

Thanks, its working fine.

I have one more requirement. I want set Nov as my first month so that if I select Q1, I should see, Nov, Dec and Jan month information.

Regards,

Viresh

Not applicable
Author

Its working fine, Thank You.

I have one more requirement. How to set Nov as my first month. So if i select Q1, i should see, Nov, Dec and Jan info.

Regards,

Viresh

aveeeeeee7en
Specialist III
Specialist III

Try this to create Quarter:

'Q'&Ceil(Num(Month(AddMonths(Date,-10)))/3)         as [Fiscal Quarter]

It will give you the result:

Q1 - Nov, Dec, Jan

Q2 - Feb, Mar, Apr

Q3 - May, Jun, Jul

Q4 - Aug, Sep, Oct

See this Post:

http://community.qlik.com/thread/108327

Regards

Aviral Nag

tresesco
MVP
MVP

Then you have to recalculate your month field preferably using preceding load like:

Load

              'Q' & Ceil(fMonth/3) as Quarter;

Load

          Mod(Month(Date#(YourDateField, 'YYYYMMDD')) -11, 12)+1        as fMonth

From <>;

Not applicable
Author

I tried this but in the Fmonth list box I am getting numbers from 1 to 12. Is it possible to show the month name instead of numbers?

aveeeeeee7en
Specialist III
Specialist III

Have you tried my logic posted above.

It will work.

See this:

Try this to create Quarter:

'Q'&Ceil(Num(Month(AddMonths(Date,-10)))/3)         as [Fiscal Quarter]

It will give you the result:

Q1 - Nov, Dec, Jan

Q2 - Feb, Mar, Apr

Q3 - May, Jun, Jul

Q4 - Aug, Sep, Oct

See this Post:

http://community.qlik.com/thread/108327

Regards

Aviral Nag

Not applicable
Author

I got it, its working fine.

thanks guys.