Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

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

how to create a month

I am having the field calender week from this one i need to create month how to do it

1 Solution

Accepted Solutions
Employee
Employee

Re: how to create a month

Do you have a field that contains a date? If so then the below should work.

Month(Fieldname) as Month,

Orders:

LOAD

applymap('Shippers_Map', ShipperID, 'MISSING') as Shipper,

ShipperID,

CustomerID,

   
EmployeeID,

   
EmployeeID as EmployeeSalesID,

   
Freight,

   
OrderDate,

   
Month(OrderDate) as Month,

   
Year(OrderDate) as Year,

   
Day(OrderDate) as Day,

   
applymap('Quarters_Map', num(Month(OrderDate)), Null()) as Quarter,

   
date(monthstart(OrderDate),'MMM-YYYY') as MonthYear,

   
OrderID,

    1
as OrderIDCounter

;

SQL SELECT *

FROM Orders

order by OrderDate ASC;

Bill

2 Replies
shaik_basha
Contributor III

Re: how to create a month

hi,

   can you please provide sample data.

Regards

Employee
Employee

Re: how to create a month

Do you have a field that contains a date? If so then the below should work.

Month(Fieldname) as Month,

Orders:

LOAD

applymap('Shippers_Map', ShipperID, 'MISSING') as Shipper,

ShipperID,

CustomerID,

   
EmployeeID,

   
EmployeeID as EmployeeSalesID,

   
Freight,

   
OrderDate,

   
Month(OrderDate) as Month,

   
Year(OrderDate) as Year,

   
Day(OrderDate) as Day,

   
applymap('Quarters_Map', num(Month(OrderDate)), Null()) as Quarter,

   
date(monthstart(OrderDate),'MMM-YYYY') as MonthYear,

   
OrderID,

    1
as OrderIDCounter

;

SQL SELECT *

FROM Orders

order by OrderDate ASC;

Bill

Community Browser