Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
trishita
Creator III
Creator III

How can I map these two tables using mapping function and apply map with conditional expressionbetween 2 tables

 

I need to map two fuel types FIELD from 2 tables, Sounding correction and Summary depending on the sulphur content of the sounding correction table.How can I map these two tables using mapping function and apply map with conditional expression

   

Sounding Correction.Fuel TypeSounding Correction.Sulphur ContentSummary.Fuel Type
DMA<.01LSDO
DMB<.01LSDO
DMC<.01LSDO
DMA>.01HSDO
DMB>.01HSDO
DMC>.01HSDO
RMA<.01ULSFO
RMG<.01ULSFO
RMD<.01ULSFO
RMA>.01HSFO
RMG>.01HSFO
RMD>.01HSFO

If (Sounding Correction.Fuel Type = ‘DM*’) and (Sounding Correction.Sulphur Content)

 

Greater than  0.1 , Summary.Fuel Type = ‘HSDO’

 

  Or else ‘LSDO’

     

If (Sounding Correction.Fuel Type = ‘RM*****’) and (Sounding Correction.Sulphur Content)

 

Greater than  0.1 then (Summary.Fuel Type) = ‘HSFO’

   

Or else ‘ULSFO’

 

16 Replies
olivierrobin
Specialist III
Specialist III

hello

something like

if(wildmatch([Sounding Correction.Fuel Type ],' ‘DM*’) and [(Sounding Correction.Sulphur Content) ],'HSDO','LSDO') as .....

same logic for the 2nd expression

trishita
Creator III
Creator III
Author

But I want to do it with mapping function, is it possible? secondly  HSDO and LSDO will come from the other table, not just any string expression...

my main goal is to map these two tables which have different codes for Fuel type

olivierrobin
Specialist III
Specialist III

you can code a similar logic tu use applymap

eg:

if(some condition,applymp(code here parameters for yes cond), applymap(code here parameters for no cond)

Anonymous
Not applicable

Hi Trishita,

For apply map function is Applymap(tablename, mapping field, nofield)

Thanks Regards,

Ramesh.P

shiveshsingh
Master
Master

Use this as your expression

if(WildMatch([Sounding Correction.Fuel Type], 'DM*') and [Sounding Correction.Sulphur Content] = '>.01','HSDO',

if(WildMatch([Sounding Correction.Fuel Type], 'DM*') and [Sounding Correction.Sulphur Content] <> '>.01','LSDO',

if(WildMatch([Sounding Correction.Fuel Type], 'RM*') and [Sounding Correction.Sulphur Content] = '>.01','HSFO',

if(WildMatch([Sounding Correction.Fuel Type], 'RM*') and [Sounding Correction.Sulphur Content] <> '>.01','ULSFO'))))

trishita
Creator III
Creator III
Author

so I don't need to use mapping load or applymap for this?

olivierrobin
Specialist III
Specialist III

of course, you must first

use map load to load your mapping tables

trishita
Creator III
Creator III
Author

Hi Oliver,

  Can you show me any example like this? I could not find it in any qlikview help or such

shiveshsingh
Master
Master

Capture.JPG

Why do you want to use mapping table? Do you want these calculations in script?

I have shared the expression for Straight table.

If you want to use it using mapping table, then it needs to be done in script. Do you have separate mapping table or something?

If you don't have any issues, you can do this in UI layer by using the expression