Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Partner
Partner

Problem dealing with dates

Hello

I run into a little problem dealing with dates. I leave below a table in which you can see the date field
I'm trying and some of the tests I've already done.

clipboard_image_2.png

The field in question is the first to appear in the table and, as you can see, has a date in 'YYYYMMDD' format.

What I have to achieve is to keep only the year, eliminating the part corresponding to the month and day. In columns 2,3,4,5 you can see some tests I have done.

I know that I could get the same result simply by running a left, as shown below, but I would like to know the reason why I can not do it in the way mentioned above, using date() and above all understand the reason why this date appears so strange numeric.

clipboard_image_1.png

Thanks to all

 

Labels (4)
1 Solution

Accepted Solutions
Partner
Partner

Re: Problem dealing with dates

the date format YYYYMMDD (SAP standard format) is one which cannot verify correctly without scripting

use

year(date#(ERDAT,'YYYYMMDD')) as Year,

date(date#(ERDAT,'YYYYMMDD')) as date

and so on

View solution in original post

2 Replies
Partner
Partner

Re: Problem dealing with dates

the date format YYYYMMDD (SAP standard format) is one which cannot verify correctly without scripting

use

year(date#(ERDAT,'YYYYMMDD')) as Year,

date(date#(ERDAT,'YYYYMMDD')) as date

and so on

View solution in original post

Partner
Partner

Re: Problem dealing with dates

It worked perfectly, thank you very much for the explanation. Greetings