Mind you, a Mapping table will be invisible to any and all except to the ApplyMap() function. ApplyMap() can use any Mapping table defined before the call is made to translate one value into another at a time.
Mapping tables also cease to exist at the end of the current script run. So the QlikView User Interface cannot make use of them. ApplyMap() therefor is a script-only function.
In fact I need the value for specific column (ThLow, ThMin, ThMed) when INo is 1,2 or 3 resp.
Meaning if INo = 1 than 0
INo=2 than whatever the value of ThLow
INo=3 than whatever the value of ThMin
INo=4 than whatever the value of ThMed
LOAD * INLINE [
Where CName column is existing column in database.
What syntax should I use so I can evaluate column CName
In CName you have values like 0,1,2 or ThLow if its 1,2 etc then
try like this in your FACT table
applymap('Mtrl',CName) as name
The ApplyMap function is used for mapping any expression to a previously loaded mapping table. The syntax is:
mapname is the name of a mapping table that has previously been created through the mapping load or the mapping select statement (see Mapping). Its name must be enclosed by single, straight Quotation Marks in Scripting.
expr is the expression, the result of which should be mapped.
defaultexpr is an optional expression which will be used as a default mapping value if the mapping table does not contain a matching value for expr. If no default value is given, the value of expr will be returned as is.
// Assume the following mapping table:
mapping load * inline [
3, three ] ;
ApplyMap ('map1', 2 ) returns ' two'
ApplyMap ('map1', 4 ) returns 4
ApplyMap ('map1', 5, 'xxx') returns 'xxx'
ApplyMap ('map1', 1, 'xxx') returns 'one'
ApplyMap ('map1', 5, null( ) ) returns NULL
ApplyMap ('map1', 3, null( ) ) returns 'three'
Indeed, but your explanation is missing a few key elements. For example, what is INo? It seems to be in control but you're not telling us whether it is a selection in the UI (a variable), a column in the same row in the same database table, a column in another database table, something else...
If INo is a column in the same row as CName, then you can use this in your script instead of the Mapping table:
Pick(INo, 0, ThLow, ThMin, ThMed) AS CNameValue,
or as an expression in a UI object:
=Pick(INo, 0, ThLow, ThMin, ThMed)