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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Heorhi11
Contributor II
Contributor II

joining tables by date

Hello,
I have this problem , I can't merge the table by date , I don't understand why it doesn't merge. I have tables generated by SQL SERVER and link from the table calendar by date.

ODBC CONNECT TO [DRIVER=SQL Server;SERVER=***;UID=***;PWD=***;DATABASE=***];
 
SQL SELECT 
dzial,
ID,
imie,
nazwisko,
ref, 
data,
//CONVERT(VARCHAR, data, 104) AS FormattedDate,
//CONVERT(VARCHAR, data, 101) AS FormattedDaateTime,
Day(data) AS Day,
Year(data) AS Year, 
Month(data) AS Month,
datepart(ww, data) as KW,
REPLACE(SUBSTRING(przejscie, 3, LEN(przejscie)), '.', '') as Przejscie,
CASE 
WHEN Month(data) BETWEEN 1 AND 3 THEN 'Q1'
WHEN Month(data) BETWEEN 4 AND 6 THEN 'Q2'
WHEN Month(data) BETWEEN 7 AND 9 THEN 'Q3'
WHEN Month(data) BETWEEN 10 AND 12 THEN 'Q4'
ELSE NULL
END AS Quarter
FROM "*****";
 
 
STORE [Exp_Obec]
INTO [C:\Test\hy\Exp_Obec.qvd] (qvd);
 
DISCONNECT;
 
//*************Exp_Obec**********\\
if(len(TableNumber('Exp_Obec')) > 0)
DROP table Exp_Obec; 
end if
 
Exp_Obec:
LOAD
//date(FormattedDate, 'DD.MM.YYYY') as %%Key_V_BelegPos_Datum,
Date(num(data), 'DD.MM.YYYY') as %%Key_V_BelegPos_Datum,
 *
FROM [C:\Test\hy\Exp_Obec.qvd] (qvd);
 
//************************Kalender_BelegPos*******************************\\
Kalender_BelegPos:
LOAD
//date(Datum, 'MM/DD/YYYY h:mm:ss AM/PM') As %%Key_V_BelegPos_Datum,
date(Datum, 'DD.MM/YYYY') As %%Key_V_BelegPos_Datum,
*
From [$(ImportPfadExport)global\Zukunftskalender.qvd] (qvd) Where  Jahr>2023 and  Typ='N'; 

Heorhi2_0-1707121487280.pngHeorhi2_1-1707121586166.png

 

Heorhi2_2-1707121610932.pngHeorhi2_3-1707121800938.png

 

when I check through by list box(Datum)) as if I don't find and not one record in Exp_Obec. The question is why?
please help!!!





Labels (1)
2 Replies
marcus_sommer

Make sure that the date is really a date and not a timestamp which is only possible with a conversion and not a formatting, for example with:

Date(floor(data), 'DD.MM.YYYY') as %%Key_V_BelegPos_Datum

Heorhi11
Contributor II
Contributor II
Author

Thank you very much!!!!!!!!!