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

Creating a table to exclude data out a single field based on multiple fields

Hi, 

I have some experience with Qlikview, I just need some help with the following

I have table of product data ( Tabel 1) , I  have created a table (Table 2 ) that links to that (Table 1) based on  field ATC and I need to perform certain exclusions based on requirements in the second table. I have attached a small set of the data with examples of the tables below. (There are multiple disease in the attached document, if it was only one disease then i could use set analysis, but since there are over 200 diseases in the complete dataset I don't think set analysis would work? Maybe I am thinking about it all wrong)

Thanks in advance Atila

Table 1

 Unique Identifier         ATCPresentation    
HYPERTENSION:883817007MEDSOL CARDIOPLEGIC INDUCTIONBBLOOD AND BLOOD FORMING ORGANSB05BLOOD SUBSTITUTES AND PERFUSION SOLUTIONSB05XI.V. SOLUTION ADDITIVESB05XAElectrolyte solutionsB05XA01INF1Y Y
HYPERTENSION:894290002MEDSOL CARDIOPLEGIC MAINTBBLOOD AND BLOOD FORMING ORGANSB05BLOOD SUBSTITUTES AND PERFUSION SOLUTIONSB05XI.V. SOLUTION ADDITIVESB05XAElectrolyte solutionsB05XA01INF1Y Y
HYPERTENSION:718369001NEPRESOL POWDER (SECT 21)CCARDIOVASCULAR SYSTEMC02ANTIHYPERTENSIVESC02DARTERIOLAR SMOOTH MUSCLE AGENTS ACTING ONC02DBHydrazinophthalazine derivativesC02DB02INJ5Y Y
HYPERTENSION:732052017HYPOTONECCARDIOVASCULAR SYSTEMC02ANTIHYPERTENSIVESC02AANTIADRENERGIC AGENTS CENTRALLY ACTINGC02ABMethyldopaC02AB01TAB500Y Y
HYPERTENSION:761400028SANDOZ HYDRALAZINECCARDIOVASCULAR SYSTEMC02ANTIHYPERTENSIVESC02DARTERIOLAR SMOOTH MUSCLE AGENTS ACTING ONC02DBHydrazinophthalazine derivativesC02DB02TAB500Y Y
HYPERTENSION:785962026MYLAN METHYLDOPACCARDIOVASCULAR SYSTEMC02ANTIHYPERTENSIVESC02AANTIADRENERGIC AGENTS CENTRALLY ACTINGC02ABMethyldopaC02AB01TAB500Y Y

 

Table 2

DiseaseATCPresentation Exclusion
HYPERTENSION:B05XA01INF,INJ,SUS,SYR
HYPERTENSION:C02AB01INF,INJ,SUS,SYR
HYPERTENSION:C02CA04INF,INJ,SUS,SYR
HYPERTENSION:C02DB02INF,INJ,SUS,SYR
HYPERTENSION:C03AA03INF,INJ,SUS,SYR
HYPERTENSION:C03BA11INF,INJ,SUS,SYR
HYPERTENSION:C03CA01INF,INJ,SUS,SYR
HYPERTENSION:C03DA01INF,INJ,SUS,SYR
HYPERTENSION:C08CA01INF,INJ,SUS,SYR
HYPERTENSION:C08CA05INF,INJ,SUS,SYR
HYPERTENSION:C08DA01INF,INJ,SUS,SYR
HYPERTENSION:C09AA01INF,INJ,SUS,SYR
HYPERTENSION:C09AA02INF,INJ,SUS,SYR
HYPERTENSION:C09AA03INF,INJ,SUS,SYR
HYPERTENSION:C09AA04INF,INJ,SUS,SYR
HYPERTENSION:C09BA03INF,INJ,SUS,SYR
Labels (3)
1 Solution

Accepted Solutions
mato32188
Specialist
Specialist

Hi,

does it help to include ATC&Preparations key in where exists?

Thanks.

Martin

ECG line chart is the most important visualization in your life.

View solution in original post

3 Replies
mato32188
Specialist
Specialist

Hi Atila,

if you want to exclude values from table 1 based on ATCLevel5 field from table 2, try:

table2:
LOAD Disease,
ATCLevel5,
[Presentation Exclusions]
FROM YOUR FILE;

NoConcatenate 
table1:
LOAD Disease,
Unique,
[Drug Name],
ATC1,
[ATC1 Desc],
ATC2,
[ATC2 Desc],
ATC3,
[ATC3 Description],
ATC4,
[ATC4 Description],
ATCLevel5,
Presentation,
Packsize,
[Chronic Disease indicator],
[Acute formualry flag],
Combined,
[Preperation Exclusions]
FROM YOUR FILE where not Exists(ATCLevel5);

drop table table2;

 BR

Martin

ECG line chart is the most important visualization in your life.
AtilaH
Contributor III
Contributor III
Author

Hi, Martin

Thanks for the response

I do but then, I need to able to also exclude based on multiple "Preparations"held in Table 2 column 3 aswell?

Regards

Andre

mato32188
Specialist
Specialist

Hi,

does it help to include ATC&Preparations key in where exists?

Thanks.

Martin

ECG line chart is the most important visualization in your life.