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

Update the field

Hi experts,

I am having one table with 6 fields including applymap.

So now my question is want to update the applymap field with conditions.

Can you please help me on the same..

Thanks in advance...

4 Replies
YoussefBelloum
Champion
Champion

Hi,

what is the condition you want to apply with the applymap ?

Please try to explain in detail what you want to do

clondono
Creator III
Creator III

Can you share a sample of your data?

Maybe something like this will work for you:

// Load mapping table of your fields:

map1:

mapping LOAD *

Inline [

Field1, Field2

Xx, YYYY      //X and Y is your data

Xxx, Yyyy

] ;

map2:

mapping LOAD *

Inline [

Field1, Field2

Xx, YYYY      //X and Y is your data

Xxx, Yyyy

] ;

// Load list dimensions

YourTableName:

LOAD *,

If(Your first condition here,

          ApplyMap('map1', Xx,'What to replace with'),

               Your second condition here,

                    (ApplyMap('map2', Xx,'What to replace with'))) As YourFieldName ;

Anonymous
Not applicable
Author

Thanks for the reply

Let us assume that i have one applymap field called name

now i need to update the name field to apple

now my condition is if (name ='mango' and product ='hai' ) THEN 'mangonew' else name

Can you please tell me  niow?

YoussefBelloum
Champion
Champion

as soon as you want to put a condition on the field name, you will have different fields (with different names), here you will have 2 different field (appe, mangonew)

Try this:

if(match(name,'mango') and match(product,'hai'),  ApplyMap('mapping_table_name', ...,'...')) As apple,


if(not match(name,'mango') and not match(product,'hai'),  ApplyMap('mapping_table_name', ...,'...')) As mangonew