Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
JustinRamsey
Creator
Creator

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
dplr-rn
Partner - Master III
Partner - Master III

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
dplr-rn
Partner - Master III
Partner - Master III

try
date(monthstart(VBAK.ERDAT), 'MM-YYYY')
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.
JustinRamsey
Creator
Creator
Author

Thank You!!! That worked! v

dplr-rn
Partner - Master III
Partner - Master III

Great. Please mark as answered and close the thread