Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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???

Labels (1)
18 Replies
Anil_Babu_Samineni
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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