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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Default Value Option in Inline

Hi,

I have below table which describe various grocery types-

NameQtySeasonCountry of Origin
Mango2SpringMexico
Orange3All SeasonsUSA
Apple4All SeasonsUSA
Fig2WinterItaly
Rice3SummerChina
Peppers5All SeasonsJamaica

I am creating inline table to attach field Type. I want to have Types as "Fruit","Crop" or "Unknown".

Load * Inline

[

Name,Type

Mango,Fruit

Orange,Fruit

Apple,Fruit

Fig,Fruit

Rice,Crop

]

Now in above list I want to add a default option which will map any other 'Name" value as "Misc".

Can you please suggest how to check it.

1 Solution

Accepted Solutions
Not applicable
Author

Ok did something like this..

Grocery_Table:

[Name,Qty,Season,Country Of Origin]

Test:  

Mapping Load * Inline

[

Name,Type

Mango,Fruit

Orange,Fruit

Apple,Fruit

Fig,Fruit

Rice,Crop

];

Load *, ApplyMap('Test',Name ,'Misc') as Type

Resident Grocery_Table;

Thanks Mayil without your advice it was not possible.

View solution in original post

5 Replies
MayilVahanan

HI,

     Use

Test:  

Mapping Load * Inline

[

Name,Type

Mango,Fruit

Orange,Fruit

Apple,Fruit

Fig,Fruit

Rice,Crop

];

Load *, ApplyMap('Test',Name ,'Misc') as FieldName from tablename;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi Mayil,

Which table name you are expecting in below line?

Load *, ApplyMap('Test',Name ,'Misc') as FieldName from tablename;

MayilVahanan

HI,

      Below table which describe various grocery types, you specified know-Please use that table ..

     Edit:After use that, let me know, its working?

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks a lot for all the help. I will try this option.

Not applicable
Author

Ok did something like this..

Grocery_Table:

[Name,Qty,Season,Country Of Origin]

Test:  

Mapping Load * Inline

[

Name,Type

Mango,Fruit

Orange,Fruit

Apple,Fruit

Fig,Fruit

Rice,Crop

];

Load *, ApplyMap('Test',Name ,'Misc') as Type

Resident Grocery_Table;

Thanks Mayil without your advice it was not possible.