# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
Contributor III

## Quarter Creation

How do I create a quarter period in my script. Please find the attached file for clarity. Thanks

Tags (1)
1 Solution

Accepted Solutions
MVP

## Re: Quarter Creation

You can use Day() function for that:

NoConcatenate

[Supply Field],

If(Len(Trim(Region)) = 0, Peek('Region'), Region) as Region,

Supplier,

Type,

[Daily Average],

[Annual Cumm],

Date(Num#(Date)) as Date,

Month(Num#(Date)) as Month,

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

MonthName(Num#(Date)) as MonthYear,

Year(Num#(Date)) as Year,

Day(Num#(Date)) as Day,

Value

I would suggest looking into a master calendar script for doing this:

And for a list of date and time function, visit help:

Date and time functions ‒ QlikView

3 Replies
MVP

## Re: Quarter Creation

This:

NoConcatenate

[Supply Field],

If(Len(Trim(Region)) = 0, Peek('Region'), Region) as Region,

Supplier,

Type,

[Daily Average],

[Annual Cumm],

Date(Num#(Date)) as Date,

Month(Num#(Date)) as Month,

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

MonthName(Num#(Date)) as MonthYear,

Year(Num#(Date)) as Year,

Value

Contributor III

## Re: Quarter Creation

Thanks Man. How about the day of the month in the script?

MVP

## Re: Quarter Creation

You can use Day() function for that:

NoConcatenate

[Supply Field],

If(Len(Trim(Region)) = 0, Peek('Region'), Region) as Region,

Supplier,

Type,

[Daily Average],

[Annual Cumm],

Date(Num#(Date)) as Date,

Month(Num#(Date)) as Month,

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

MonthName(Num#(Date)) as MonthYear,

Year(Num#(Date)) as Year,

Day(Num#(Date)) as Day,

Value

I would suggest looking into a master calendar script for doing this:

And for a list of date and time function, visit help:

Date and time functions ‒ QlikView