Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I'm very new to Qlikview and need your help to extract only a year from the date.
My source data is simple excel. Order date in the format mm/dd/yyyy. I'm using below Subfield function to extract only year from order date and ship date. When I reload the data and preview the table, it doesnt show any year in loaded table preview.
Please help me if I'm missing anything here. Thanks in advance. Below is the SQL im trying to load.
Please let me know if any addition info required.
NoConcatenate LOAD [Row ID],
[Order ID],
[Order Date],
SubField([Order Date],'/',3) AS Saleyear,
[Ship Date],
SubField([Ship Date],'/',3) AS Shipmentyear,
[Ship Mode],
..
FROM
You can use the below in script
LOAD [Row ID],
[Order ID],
[Order Date],
Year([Order Date]) as Year,
Month([Order Date]) as Month,
[Ship Date],
Year([Ship Date]) as Year,
Month([Ship Date]) as Month,
like this you can derive
First thing to check would be to see if [Order Date] and [Ship Date] are read correctly by QlikView. To learn how to check this look here:
Once the dates are read correctly, simply use the Year() function to extract date from your Date fields (just like pointed out by arumamahesh)
Excellent.It worked. Thanks Umamaheshwara and Sunny