Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
trishita
Contributor 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
Valued Contributor II

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

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
Contributor III

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

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
Valued Contributor II

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

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)

rameshpasupulet
New Contributor

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

Hi Trishita,

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

Thanks Regards,

Ramesh.P

shiveshsingh
Honored Contributor

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

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
Contributor III

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

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

olivierrobin
Valued Contributor II

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

of course, you must first

use map load to load your mapping tables

trishita
Contributor III

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

Hi Oliver,

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

shiveshsingh
Honored Contributor

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

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