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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change date field

My database contains many date fields like:

01-01-2009
01-02-2009
01-03-2009
01-03-2009

02-01-2009
02-02-2009
etcetera

I would like Qlikview to give a selection by month instead of days. Changing numberfield to date won't help? So can Qlikview sumarise 01-01-2009 to januari 2009 etc ?

1 Solution

Accepted Solutions
prieper
Master II
Master II

Use the date-functions, e.g. your script may look like


LOAD *, MonthName(Date) AS Month;
LOAD Date#(YourDate, 'MM-DD-YYYY') AS Date FROM .....;


HTH
Peter

View solution in original post

4 Replies
Not applicable
Author

=monthname(makedate(right(datefield,4),left(datefield,2), mid(datefield,4,2)))





prieper
Master II
Master II

Use the date-functions, e.g. your script may look like


LOAD *, MonthName(Date) AS Month;
LOAD Date#(YourDate, 'MM-DD-YYYY') AS Date FROM .....;


HTH
Peter

Not applicable
Author

I've used the date-function you mentioned. Now I can select months but the link does not work.







LOAD





Group, Name, MSISDN, Date, Costs

FROM

(

txt, codepage is 1252, embedded labels, delimiter is ',', msq);

LOAD

*, MonthName(Date) AS Month;



LOAD

Date#(Date, 'MM.DD.YYYY') AS Date

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);





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

The link between the 2 tables now exists (my table and the date table). Date is linked to date in the other table.

When I select a month e.g. jan 2009, everything becomes empty. When I change it back to a date 01.01.2009, than I see the costs for that day. I want to see al cost for januari when I select januari. Whats wrong?

Not applicable
Author

I fixed it. It was a problem with the standard date settings. Big Smile