Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
akpofureenughwu
Creator III
Creator III

Quarter Creation

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

1 Solution

Accepted Solutions
sunny_talwar

You can use Day() function for that:

NoConcatenate

LOAD [S/N],

    [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:

Creating A Master Calendar

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

Date and time functions ‒ QlikView

View solution in original post

3 Replies
sunny_talwar

This:

NoConcatenate

LOAD [S/N],

     [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

akpofureenughwu
Creator III
Creator III
Author

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

sunny_talwar

You can use Day() function for that:

NoConcatenate

LOAD [S/N],

    [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:

Creating A Master Calendar

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

Date and time functions ‒ QlikView