Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi.
I have two tables and doing left join
Items:
SQL SELECT
CustID,
OrderNo,
OrderType,
ReqNo,
ReqDate
FROM Table1
where
ReqDate>= '2016/02/26' and ReqDate<= '2016/03/26';
left join (Items)
SQL SELECT
ProductMasterID,
ProductName,
ReqNo
FROM .Table2;
Table1 return 2lacs record and Table 2 retursn 4 lacs when we run this query in database
but in Qlikview
table 1 returns 2 lacs
where as table 2 is fetching more that 10 crores
so basically doing cross join.
Please guide what wrong I am doing.
TIA
Here,
How is your Data model
Just these two tables only
joined on basis of reqno
If those tables are into same database, keep your script making joins using SQL not Qlik.
Believe me, much more optimized
Items:
SQL SELECT
CustID,
OrderNo,
OrderType,
ReqNo,
ReqDate
FROM Table1
where
ReqDate>= '2016/02/26' and ReqDate<= '2016/03/26';
// For this you will get 1 month Data only
left join (Items)
concatenate / Join (Items)
SQL SELECT
ProductMasterID,
ProductName,
ReqNo
FROM .Table2 group by ReqNo;
Final Out put is
CustID OrderNo OrderType ReqNo ReqDate ProductMasterID ProductName
These tables are coming from same database. but I didn't get your point
you are saying do concatenate instead of join?
SELECT
CustID,
OrderNo,
OrderType,
ReqNo,
ReqDate ,
ProductMasterID,
ProductName
FROM Table1
LEFT join Table2 on Table1.ReqNo = Table2.Reqno
where
ReqDate>= '2016/02/26' and ReqDate<= '2016/03/26';
this is database query .
In Qv also we write like this?