Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlikies,
I came across a below situation in applymap function,
Below is my example: Here i have to give 'Status' as a selection but it's not giving expected value as source file bringing extra values which is not matching with the mapping table value.
Below is my code:
Mapping_Table:
Mapping LOAD * INLINE [
ID, Status
1, Pass
2, Pass
3, Pass
4, Fail
5, Fail
6, Fail
7, Pass
8, Fail
9, Pass
];
Table:
LOAD ID,
City,
ApplyMap('Mapping_Table', ID)As Status
FROM
Applymap.xlsx
(ooxml, embedded labels, table is Sheet1);
Code providing below output:
Expected Output: only Fail and Pass
Thanks!
Pooja
Hi Poooja
ApplyMap function syntax is:
ApplyMap('map_name', expression [ , default_mapping ] )
You must 3rd value 'default_mapping', this value will be used as a default value if the mapping table does not contain a matching value for expression. If not stated, the value of expression will be returned as is.
You can read more about Applymap syntax here https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Scripting/Ma...
Use something like:
ApplyMap('Mapping_Table', ID, 'Unknown') as Status
Hi
in Apply map function if ID is not in the mapping table it will show you the actual ID instead of related value suppose
in mapping table you dont have value for ID 11 then while using apply map function it will show you 11 but if you have value for ID 10 as Yes then it will show Yes
I hope this explains your question
Thanks
Kushal
Hi Poooja
ApplyMap function syntax is:
ApplyMap('map_name', expression [ , default_mapping ] )
You must 3rd value 'default_mapping', this value will be used as a default value if the mapping table does not contain a matching value for expression. If not stated, the value of expression will be returned as is.
You can read more about Applymap syntax here https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Scripting/Ma...
Use something like:
ApplyMap('Mapping_Table', ID, 'Unknown') as Status
Hi
in Apply map function if ID is not in the mapping table it will show you the actual ID instead of related value suppose
in mapping table you dont have value for ID 11 then while using apply map function it will show you 11 but if you have value for ID 10 as Yes then it will show Yes
I hope this explains your question
Thanks
Kushal