Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional Loading of Data

Hi,

Let me explain my problem with an example:

File A - contains name and age of all student in a class

File B - contains address of all the students in the school

I want a qlikview with name, age & adddress of the student of the class & hence I want to load the address of the students who are in that particular class and not for all the students in the school

Should be a simple query, But i would be really garteful if someone can helo me out

thanks 🙂

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Here you are the sample code. Please note that the load is being done from Excel sheets, so you will need to change the FROM clause in any case.

Table1:LOAD Name, AgeFROM[A.xls](biff, embedded labels, table is Sheet1$);INNER JOINLOAD Name, Address, FatherFROM[A.xls](biff, embedded labels, table is Sheet2$);


View solution in original post

6 Replies
Miguel_Angel_Baeyens

Hello,

Try with

LOAD ... FROM Table WHERE ClassNameField = 'A'


Where "..." are the fields you want to get, Table is the table or file where your datasource is located and ClassNameField the name of the field where you store students's addresses.

Let us know if this worked.

Regards.

Not applicable
Author

Hi,

thanks for the reply, but in my case there are other fields as Parents Name, Nationality etc in the 2nd file and the Key Term linking both the files is the 'NAME'and I want all the details of the student loaded form file B

Miguel_Angel_Baeyens

Hi,

To link two fields in QlikView the only thing you need is to name two fields identically. But you may need a inner join load, so we need your field definition in order to help you.

But for what you are telling, and having that the field "NAME" exists in both tables with the same name and data, and that the rest of the fields in both tables have different names the load would be something like

LOAD * FROM TABLE1 WHERE ClassFieldName = 'A';
INNER JOIN
LOAD * FROM TABLE2;


Not applicable
Author

I guess i am quite new to qlikview and not able to understand scripting easily , I am attaching aan excel file with dummy data in two sheets

Sheet1 - has Name & Age

Sheet2 - has Name, Addresss & Father

I need to load Sheet1 fully & from Sheet2 Address & Father of only those people who are present in Sheet1, if you can give me specific solution for the same would be a great help

thanks

Miguel_Angel_Baeyens

Here you are the sample code. Please note that the load is being done from Excel sheets, so you will need to change the FROM clause in any case.

Table1:LOAD Name, AgeFROM[A.xls](biff, embedded labels, table is Sheet1$);INNER JOINLOAD Name, Address, FatherFROM[A.xls](biff, embedded labels, table is Sheet2$);


Not applicable
Author

Thank You for the code, really appreciate it, I have been able to replicate the same