Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

hi

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

thanks

Tags (1)
12 Replies
MVP
MVP

Re: hi

Try like:

     Load

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

MVP
MVP

Re: hi

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

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

Not applicable

Re: hi

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

Re: hi

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
Valued Contributor III

Re: hi

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

MVP
MVP

Re: hi

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

Re: hi

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
Valued Contributor III

Re: hi

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

Re: hi

I got it, its working fine.

thanks guys.

Community Browser