Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date issue

Dear expert

I am new to Qlikview

in my data base I have a field for dates and the format is dd/mm/yy

now using script i want to crate a column for month separate and year separate

So please tell me how we can do it

Faisal

5 Replies
swuehl
MVP
MVP

Maybe like this:

Set DateFormat = 'DD/MM/YY';

LOAD

...

DateField,

year(DateField) as Year,

month(DateField) as Month,

Date(monthstart(DateField),'YYYY-MMM') as Monthstart,

...

from YOURTABLE;

Not applicable
Author

Hi thank you for the fast reply

but still i am not able to get the answer

so please see the script i written

------------

LOAD * Inline

[
Invoice Date,

year(Invoice Date) as Year,

month(Invoice Date) as Month,

]

--------------

please tell me wether i was written correct?

Faisal

Not applicable
Author

Hi thank you for the fast reply

but still I am not able to get the answer

so please see the script i written

------------

LOAD * Inline

[
Invoice Date,

year(Invoice Date) as Year,

month(Invoice Date) as Month,

]

--------------

please tell me wether I was written correct?

Faisal

swuehl
MVP
MVP

Do you want to load from a DB / file or state the values as INLINE table? If latter, I think the actually values are missing and you should use the QV functions in the actual load statement, like

LOAD

[Invoice Date],

year([Invoice Date]) as Year,

Month([Invoice Date]) as Month

INLINE [
Invoice Date

30/01/12

01/01/12

15/12/11

28/02/10

07/07/09

];

kamalqlik
Partner - Specialist
Partner - Specialist

Hi friend...

Above you have mentioned the value in inline table.

You have to first make the entry in your inline table.

ie'

Invoice:

load * inline [

invoicedate

26/01/2012

27/01/2012

29/01/2012

than you can use the resident of above table

Final:

load invoicedate,

year([Invoice Date]) as InvoiceYear,

Month([Invoice Date]) as Invoicemonth

resident Invoice;

drop table Invoice;

thanks and regards

Kamal