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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create Year, Month and Quartile Fields

Hi,

I am currently running the following script loading data from an Acces File (.mdb), this load is running smoothly. In the field 'Orderdate' the date is mentioned as DD-MMM-YY (i.e. 13-jul-03), I have also set my variableas: SET DateFormat='DD-MMM-YY'; I guessing that these settings are okay?

Now I would like to create fields for Year, Month and the Quartile, enabling me to make a selection box as follows.

What is the best way to fix this? Is it possible to create fields without adjusting the load script and how?

OLEDB CONNECT32 TO [Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\Program Files\QlikView\Documenten opdracht\Datasources\QWT.mdb;Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False];

//-------- Start Multiple Select Statements ------

SQL SELECT CustomerID,

    EmployeeID,

    Freight,

    OrderID,

    ShipperID,

    OrderDate

FROM Orders;

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

LOAD *,

     Year(OrderDate) as Year,

     'Q' & ceil(Month(OrderDate)/3) as Quarter,

     Month(OrderDate) as Month;

SQL SELECT CustomerID,

    EmployeeID,

    Freight,

    OrderID,

    ShipperID,

    OrderDate

FROM Orders;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

LOAD *,

     Year(OrderDate) as Year,

     'Q' & ceil(Month(OrderDate)/3) as Quarter,

     Month(OrderDate) as Month;

SQL SELECT CustomerID,

    EmployeeID,

    Freight,

    OrderID,

    ShipperID,

    OrderDate

FROM Orders;


talk is cheap, supply exceeds demand
Not applicable
Author

Thank You! It worked immedeately!