Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to load a qvd table with a condition that one of the fields is connected to another table that is already loaded and defines that field availability. Here is an example:
Load Param01, Param02 from Table01 (qvd)
This table is loaded first in the process and it contains two fields.
The field Param01 is a key field that links between Table01 and Table02.
Now I load the data in Table02 but only records where the corresponding field Param02 in Table01 for the record Param01 complies with the condition.
Load Param03, Param04, Param01 from Table02 (qvd)
where Param02<>5
Is this possible?
Thanks
Finally I got the solution, based on your advise 🙂 Thank you so very much
Try below.
T1:
LOAD Param01,
Param02
FROM Table01 (qvd);
T2:
Load Param03,
Param04,
Param01
FROM Table02 (qvd)
Where Exists(Param01,Param02) and Param02 <> 5;
DROP Table T1;
Thanks, that's a great solution.
Still it doesn't work 😞 Somehow it seems that when I load Table02 the system still doesn't know Table01 although it is loaded first. Any other suggestion? Or Correction? Maybe I am missing something...Thanks
It's not quite clear how your condition should work respectively which records should remain? It would be helpful if you elaborate it in more details, for example by providing about 5 (dummy) records of each qvd and which records from them should be kept and removed.
In fact, my goal is to add a field to the table.
Here is an example:
Table A - Hospitals:
Fields: Hospital_name, Hospital_ID, IsGeneral (logical field)
HospA - ID01 - TRUE
HospB - ID02 - FALSE
and so on...
The second Table - People in Hospitals
Fields: Hospital_ID, Person_ID , Age
ID01 - P01 - 23
ID01 - P02 - 39
ID02 - P03 - 45
ID02 - P04 - 72
ID01 - P05 - 81
Actually I want to load the table People in Hospitals where I can add for each record the Hospital name, only if the field ISGENERAL (from the first table, that corresponds to the the Hospital_ID which is the key between the two tables) is TRUE. All the records in the second table where Hospital_ID in the first table is FALSE are not loaded...
This is necessary for further analysis.
Any help would be appreciated.
Thanks,
Zohar.
Intuitively I would do:
Load * from TableA (defining the conditions, as measures)
Load * from TableB where (TableA.Hospital_id=TableB.hospital_ID) and (TableA.IsGeneral=TRUE)
Any suggestions would be highly appreciated. Thanks
I think I would do something like this:
temp: load true() as IsGeneral autogenerate 1;
first: load ID, IsGeneral from first.qvd (qvd) where exists(IsGeneral);
second: load * from second.qvd (qvd) where exists(ID);
drop tables temp, first;
I still have a problem with the "exists" clause [exists IsGenera].
The following error occurred:
Unexpected token: 'IsGeneral', expected one of: 'biff', 'dif', 'fix', 'html', 'json', 'kml', 'ooxml', ...
Any idea what I did wrong?
It seems that there is any load-statement-ending character of ; is missing and Qlik concatenates multiple statements and couldn't find a valid file-format for a load.