Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a field in my script called "Ordering_Date", the format of this column is set as a date (see attached image). I would like to create another field that essentially is a column that captures just the year and month, in the format "YYYMM" from the Ordering_Date field as well as a column that captures just the year. Would this be a convert formula? What should I add to my script to load those two requested columns?
Please advise.
Thanks in advance,
Clem
OK, I see the problem. You have two sections, the SQL part that runs the query against your Oracle database, and the LOAD part that tells Qlik what to do with those query results. This sentences must be included in the LOAD part as they are Qlik functions, something like this:
LOAD
*,
Date(MonthStart(ORDERING_DATE), 'YYYMM') AS Ordering_Month,
Year(ORDERING_DATE) AS Ordering_Year
;
SELECT ....
FROM ...
;
And don't forget to remove those lines from the SQL sentence, as Oracle doesn't understand the Qlik functions.
JG
Try this:
Date(MonthStart(Ordering_Date), 'YYYMM') AS Ordering_Month,
Year(Ordering_Date) AS Ordering_Year
JG
Thanks for your reply. I added your suggestion to my script:
Didn't work 😞 I got the following error:
You must use the source field: PROC.ORDERING_DATE
JG
Hi JG,
I tried that as well and it still did not work 😞
OK, I see the problem. You have two sections, the SQL part that runs the query against your Oracle database, and the LOAD part that tells Qlik what to do with those query results. This sentences must be included in the LOAD part as they are Qlik functions, something like this:
LOAD
*,
Date(MonthStart(ORDERING_DATE), 'YYYMM') AS Ordering_Month,
Year(ORDERING_DATE) AS Ordering_Year
;
SELECT ....
FROM ...
;
And don't forget to remove those lines from the SQL sentence, as Oracle doesn't understand the Qlik functions.
JG
JG, you are a genius 🙂 Your suggestion worked.
Thank you so much!!
Clem