Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I separate the DateFormat from Source ODBC? for Dashboads

Hi,

I want to work with my Database

After Connecting and Selecting (SQL), I want to create new objects like dates by separating this.

How can I separate the "Posting Date" in Month, Year and other Combination?

Should I use the function in Script or  via Listbox ?

CONNECT TO Navision;

SQL SELECT "Posting Date",

FROM "DB.X.Y";


1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi try as below

CONNECT TO Navision;


load

"Posting Date"

Mont("Posting Date") as Month,

;Year("Posting Date") as Year

SQL SELECT *,

FROM "DB.X.Y";


hope it helped.


Regards

ASHFAQ

View solution in original post

4 Replies
ashfaq_haseeb
Champion III
Champion III

Hi try as below

CONNECT TO Navision;


load

"Posting Date"

Mont("Posting Date") as Month,

;Year("Posting Date") as Year

SQL SELECT *,

FROM "DB.X.Y";


hope it helped.


Regards

ASHFAQ

Not applicable
Author

Hi, In the Load script starting , we have some pre defined SET statements.

SET DateFormat='M/D/YYYY';

SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';

Please change these variables into respective required format.

If you want create a Month & Year fields, use the Date functions like Month , Year etc to get the required new fields

Year(Date_Field) AS Year_Field

Month(Date_Field) AS Month_Field

MonthName(Date_Field) AS MonthName_Field

etc..

Anonymous
Not applicable
Author

Table1:

load

"Posting Date"

Mont("Posting Date") as Month,

;Year("Posting Date") as Year

SQL SELECT *,

FROM "DB.X.Y";

Load

Posting Date,

Year(Posting Date) as Year,

Month Name(Posting Date) as month,

Quarter Name(Posting Date) as Qrt

Resident Table1

Not applicable
Author

Ah, now I understand how to work with all the tables from the database as source thx much