Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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";


Tags (3)
1 Solution

Accepted Solutions

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

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

4 Replies

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

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

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

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..

venkatasreekant
Valued Contributor

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

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

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

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

Community Browser