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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
caniwhz1
Contributor III
Contributor III

Formate Date

Hello,

I have a problem with transferring a date column to QlikView.

In the original file, it is in YYYY / MM / DD format. When transferred to QlikView, the column is displayed in the list box (or also in the table) as follows [YYYY / MM / DD]. Filterings or calculations are thus not possible (because of the square bracket). Reformatting in QlikView did not work either. In the original date format I can not change anything, since I read this from another program.

My questions:

Is it possible to decompose the date column in year, month and day so that I can see three columns?

Or.

How can I determine when importing the file to QlikView that I only import the data for a given year.

Thanks in advance for the support. I have not worked very long with QlikView, so my knowledge in some areas is still not so great.

Cathleen N.

15 Replies
caniwhz1
Contributor III
Contributor III
Author

Thank you.

Only one question:

On which point I insert the command?

SET TimeFormat='hh:mm:ss';

SET DateFormat='YYYY.MM.DD';

SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';

SET MonthNames='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';

SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';

...

Directory;

LOAD

         Date(Date#(StartTermin, 'YYYY/MM/DD'), 'YYYY/MM/DD') as MyDate,

         Year(Date#(StartTermin, 'YYYY/MM/DD')) as MyYear,

         Month(Date#(StartTermin, 'YYYY/MM/DD')) as MyMonth

    

FROM

Anonymous
Not applicable

try this

load

Date(Date#(YourDateField),'YYYY/MM/DD') as NewDate;

from XXX

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Date(Date#(mid('[2016/12/30]', 2, 10), 'YYYY/MM/DD')) as Date_new

Instead of '[2016/12/30]' use your date field in script, this may work.

The previous code returns:

Screenshot_1.jpg

caniwhz1
Contributor III
Contributor III
Author

Thank you so much. !!!!!!!!!!!!!!!!!!!!!!!!!!!!

It works

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

LOAD

      Date(Date#(mid(StartTermin, 2, 10), 'YYYY/MM/DD')) as Date_new

    ,Year(Date(Date#(mid(StartTermin, 2, 10), 'YYYY/MM/DD'))) as Year_new 

    ,Month(Date(Date#(mid(StartTermin, 2, 10), 'YYYY/MM/DD'))) as Month_new 

  

FROM

caniwhz1
Contributor III
Contributor III
Author

Thank you for the help