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: 
userid128223
Creator
Creator

please explain

I am confused please explain

SALES:

SQL SELECT

PhoneNumber,

CustNo,

InvoiceDate

FROM ............;

If I want to manipulate date and that to show up in SALES Tables how do i do it.

when i try this, gives me field not found error.

SALES:

SQL SELECT

PhoneNumber,

CustNo,

InvoiceDate

Date( Date#( InvoiceDate, 'YYYYMMDD'), 'YYYYMMDD') as tmpDate

FROM ............;

If I try this. It gives me my date but omits other field and doe not create SALES table, instead creates "table" with tmpDate

LOAD Date( Date#( InvoiceDate, 'YYYYMMDD'), 'YYYYMMDD') as tmpDate;

SALES:

SQL SELECT

PhoneNumber,

CustNo,

InvoiceDate

FROM ............;

How can i read date via SQL, manipulate date and show up in same table. Please help.

thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think you are almost there, use a preceding load to be able to use QV functions, like in your last try:

SALES:

LOAD *,

Date( Date#( InvoiceDate, 'YYYYMMDD'), 'YYYYMMDD') as tmpDate;

SQL SELECT

PhoneNumber,

CustNo,

InvoiceDate

FROM ............;

or

SALES:

LOAD PhoneNumber, CustNo,

Date( Date#( InvoiceDate, 'YYYYMMDD'), 'YYYYMMDD') as InvoiceDate;

SQL SELECT

PhoneNumber,

CustNo,

InvoiceDate

FROM ............;

if you just want to format InvoiceDate without creating tmpDate.

Hope this helps,

Stefan


View solution in original post

2 Replies
swuehl
MVP
MVP

I think you are almost there, use a preceding load to be able to use QV functions, like in your last try:

SALES:

LOAD *,

Date( Date#( InvoiceDate, 'YYYYMMDD'), 'YYYYMMDD') as tmpDate;

SQL SELECT

PhoneNumber,

CustNo,

InvoiceDate

FROM ............;

or

SALES:

LOAD PhoneNumber, CustNo,

Date( Date#( InvoiceDate, 'YYYYMMDD'), 'YYYYMMDD') as InvoiceDate;

SQL SELECT

PhoneNumber,

CustNo,

InvoiceDate

FROM ............;

if you just want to format InvoiceDate without creating tmpDate.

Hope this helps,

Stefan


Not applicable

You are missing a comma after InvoiceDate

InvoiceDate   <---

Date( Date#( InvoiceDate, 'YYYYMMDD'), 'YYYYMMDD') as tmpDate

Stephen