Qlik Community

Ask a Question

App Development

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

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
davidmoises
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
martinpohl
Partner
Partner

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
martinpohl
Partner
Partner

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

davidmoises
Partner
Partner
Author

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