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: 
irmantas
Contributor III
Contributor III

How load date YYYY-MM

Hello all,

From SQL I am loading  data like this :

Year(INVOICEDATE) as Year,

Month(INVOICEDATE) as Month,

Day(INVOICEDATE) as Day,

But i need load field like this : YYYY-MM

I was try :Year(INVOICEDATE)&'-'& Month(INVOICEDATE) as YearMonth,

But result is 0

Is it posable???

18 Replies
Anil_Babu_Samineni

Which version of QV you are with? And where you are trying? Can you show image atleast

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
irmantas
Contributor III
Contributor III
Author

My QV version 12.0

I need dimension for filtering 'Year-Month'

My load script is:

Anil_Babu_Samineni

Date# functions works only QV not for SQL, Anyway, Can you try this?

ODBC..

Load *, Date(Date#(....));

SQL SELECT * FROM ..;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
irmantas
Contributor III
Contributor III
Author

You mean:

But result is BLANK

Anil_Babu_Samineni

Give, Between space from Load and * like

Load *, Date....

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
irmantas
Contributor III
Contributor III
Author

The same, no data in YearMonth field.

Anil_Babu_Samineni

Image please for DateField?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
andrei_delta
Partner - Creator III
Partner - Creator III

hi,

this is the sql command for getting YYYY-MM from current time : convert(varchar(7), getdate(), 126)

irmantas
Contributor III
Contributor III
Author

Working:

convert(varchar(7), INVOICEDATE, 126) as YearMonth,

Thank you