Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
JustinRamsey
Contributor III
Contributor III

Date Format Issue

Good Afternoon, 

I am having an issue with the format of dates. The table import from SAP into Qlik has the dates formatted YYYY-MM-DD. For the reports I am building I only care about the month and year and I would like the dates to be formatted MM-YYYY. The field Im interested in is VBAK.ERDAT.  The line loading code I have attempted is below and has not worked. The date is still being imported as YYYY-MM-DD. Any suggestions? 

 

VBAK.ERDAT,
Date(Date#(VBAK.ERDAT,'YYYY-MM-DD'),'MM_YYYY') as CreatedOn,

2 Solutions

Accepted Solutions
dilipranjith
Partner
Partner

try
date(monthstart(VBAK.ERDAT), 'MM-YYYY')

View solution in original post

ziadm
Specialist
Specialist

what is the return value of Num(Date#(VBAK.ERDAT,'YYYY-MM-DD')) .. if its not a date range number of 5 digits ( 43521 for today) , then you are reading a wrong date format from the DB .. Try to get the correct date format from the DB.

View solution in original post

4 Replies
dilipranjith
Partner
Partner

try
date(monthstart(VBAK.ERDAT), 'MM-YYYY')

View solution in original post

ziadm
Specialist
Specialist

what is the return value of Num(Date#(VBAK.ERDAT,'YYYY-MM-DD')) .. if its not a date range number of 5 digits ( 43521 for today) , then you are reading a wrong date format from the DB .. Try to get the correct date format from the DB.

View solution in original post

JustinRamsey
Contributor III
Contributor III
Author

Thank You!!! That worked! v

dilipranjith
Partner
Partner

Great. Please mark as answered and close the thread