Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mapping Table Where

Hi

I have a main table (part 😎 that is joining to another table (part3) only where the id is IN part 8.

I switched over to mapping tables in the script, and I want to apply the field a in part 8, but it is only created in the following left join, and it is not finding the table.

I have part 8 bringing in all of my fields including 1 and 2, the left join below is because in this instance only (there are 8 parts but this only happens when we are at part 😎 we want part 3 fields to be brought in only when the id is in part 8. When there is a natural join, part 3 brings in all fields but we need the specific population.

Hope this makes sense! Thanks!

Part8:
LOAD ..... FROM

LEFT JOIN(Part8)
LOAD
[id],
[id2],
[id3],
sum([1]) as [field a]
sum([2]) as [field b]
resident [Part 3]
group by [Cedent/ Reinsurer],[Cedent Institution Name],[Cedent NAIC Company Code];

--------------------------------

[ML_Part3_Join_Funds]:
Mapping Load
[Cedent/ Reinsurer],
SUM([Part3_Join_field a]) as [field a]
Resident [Part 3]
Group by [ID];

1 Solution

Accepted Solutions
rubenmarin

Hi Laila, I'm not sure if you're looking for something like this:

MappingField_a:

Mapping LOAD
[id],
sum([1]) // as [field a]
resident [Part 3]
group by [id];


MappingField_b:

Mapping LOAD
[id],
sum([2]) // as [field b]
resident [Part 3]
group by [id];


Table1:

LOAD Id

Name

Phone

YesorNo

If(YesorNo='YES', Applymap ('MappingField_a',Id,'N/A') as [Part 3_field a]

If(YesorNo='YES', Applymap ('MappingField_b',Id,'N/A') as [Part 3_field b]

From...





View solution in original post

7 Replies
sunny_talwar

I have no idea what you are trying to do. Do you possibly share your application?

MarcoWedel

please try to explain with sample data and expected result.

Not applicable
Author

Table1:

Id

Name

Phone

YesorNo

Applymap ('MappingTable1',[YesorNo],'N/A') as [Table1Id], WHERE YesorNo=YES

From...

avinashelite

You need to load you mapping table first than you need to call the table later..

I guess you have not loaded the mapping table first ..so that's causing the issue.

Load you mapping table first and then check

Not applicable
Author

No I loaded my mapping table, I just want to know the "Where" Syntax...Is that right? It doesn't seem to be working.

rubenmarin

Hi Laila, I'm not sure if you're looking for something like this:

MappingField_a:

Mapping LOAD
[id],
sum([1]) // as [field a]
resident [Part 3]
group by [id];


MappingField_b:

Mapping LOAD
[id],
sum([2]) // as [field b]
resident [Part 3]
group by [id];


Table1:

LOAD Id

Name

Phone

YesorNo

If(YesorNo='YES', Applymap ('MappingField_a',Id,'N/A') as [Part 3_field a]

If(YesorNo='YES', Applymap ('MappingField_b',Id,'N/A') as [Part 3_field b]

From...





avinashelite

try link this

Table1:

LOAD Id,

Name,

Phone,

YesorNo,

Applymap ('MappingTable1',[YesorNo],'N/A') as [Table1Id]

WHERE YesorNo='YES'

From...