Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

concatenate and queries

I'm new in Qlick.

imagine 2 fact tables one of pharmacy and other of laboratory.If  they  are concatenated in a one fact table table.

How do I know the patients of drug x who have a laboratory test?. 

In SQL this  question  would be answered with a query between the two tables with a join. The two tables have in common only the patient identifier.

Can I answer if I concatenate the two fact tables? or is necessary that they need to be seperated.

Thanks.

7 Replies
Michiel_QV_Fan
Specialist
Specialist

Concatenation will force QlikView to combine the tables, regardless of the structure and content. Equal named columns will be added in each other and unknown columns are simply added.

Your patientid should have the same name and then the data wll be available per patientid.

So, probably, yes.

malini_qlikview
Creator II
Creator II

Hi,

Concatenate is used when you need to merge two or more tables that have identical structures. In the example you have explained, other than patient identifier there is no other columns identical then it is better to keep the tables separate linked to patient identifier.

mphekin12
Specialist
Specialist

Check out this document.  It will help you understand the differenct between the Join and Concatenate functions.  I would like to give credit to the person who created it, but I don't remember where I got it.

Hope it helps!

mphekin12
Specialist
Specialist

Malini,

I don't believe your statment is correct.  Here is a description of Concatenate from the help text:

A concatenation is in principle the same as the SQL UNION statement, but with two differences: first that Concatenate prefix can be used no matter if the tables have identical field names or not; and secondly that no removal of identical records are made.

malini_qlikview
Creator II
Creator II

Hi,

Though you can force concatenate the tables, I meant to say Concatenate statement could be recommended  where you need to merge two or more tables that have identical structures and pertaining to the situation.

Not applicable
Author

Thank you very much.

I expose an example,I think is better to can answer my question.

Suppose a Table of pharmacy

patient id   drug   date_pharmacy

1              A        20150101

1              B         20150203

2              A         20150210

2              A         20150705

2              C          20150812

3              A          20140312

4               B          20140123

other of laboratory

patient id  test_type   date_lab

1               3              20150109

1               7               20150206

3               3               20140320


if i concanate.



patient id   drug   date_pharmacy        test_type  date_lab

1              A        20150101

1              B         20150203

2              A         20150210

2              A          20150705

2              C          20150812

3              D          20140312

4               B          20140123

1                                                                3              20150109

1                                                                 7               20150206

3                                                                 3               20140320


Can I answer, with this estructure,  the patients  of drug A , that they have a test type  3?

I have a lot of Fact tables with similar estructures. Can I have two or more link tables in Qlikview?.

Thank you very much.

Not applicable
Author