Discussion Board for collaboration on QlikView Scripting.
Is it possible to mimic a sub query in an SQL IN clause when loading from a qvd? I have a master list in a qvd file but only want to load data that is already present in my resident tables.
For instance I have Tab1 and Tab2 both with the field ‘GP’ for instance:
I have a master list of GPs in a qvd file but I only want to load GPs that are in both Tab1 and Tab2.
Please note that Tab1 and Tab2 are resident tables.
I am looking for the equivalent of:
masterPrac:NoConcatenateLOAD GP AS bridgeGP From D:\Qlikview\QV Data\tbl_GP.qvd (qvd)Where GP IN(SELECT sGP Resident Tab1) AND GP IN(Select pGP Resident Tab2);
LOAD GP AS bridgeGP
From D:\Qlikview\QV Data\tbl_GP.qvd (qvd)
Where GP IN(SELECT sGP Resident Tab1)
AND GP IN(Select pGP Resident Tab2);
Go to Solution.
should be solved by slightly chnaging the creation of your master list as follows:
sGP as bridgeGP
inner join (bridgeGP) load
pGP as bridgeGP
then rest of code as above
the code should look somehing like this (untested)
load GP as bridgeGP
from your qvd file here
drop table bridgeGP;
Thanks I'll give that a go!
Thank you again for the reply.
That essentially is what I have at the moment. I need something that will give me only the values that are in both Tab1 and Tab2.
For example if Tab1 has the value ‘A76’ but Tab2 does not then the masterPrac table should not contain ‘A76’.
Also if Tab2 has the value 'G29' and 'G29' is not in Tab1 then masterPrac should not contain 'G29'.
That worked, thank you!
Still getting used to the QV load scripts.
As an addition I used the DISTINCT qualifier, which seemed to reduce the loading time somewhat.
Many thanks again!