Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

gmenoutis
Contributor

map using dual

If I use this in Qliksense:

YesNoMap:
MAPPING LOAD num, dual(str, num) INLINE [
num, str
0, No
1, Yes
];

MAP Shipped USING YesNoMap;


Then Shipped (after a load) does NOT work as dual, as intended. Is the functionality not yet implemented?

Tags (1)
2 Replies

Re: map using dual

It should work. Maybe there is a mistake with the fieldnames or your order of the actions is wrong. If I do the following in QlikView it worked (switching to autogenerate just to avoid potential problems with the number-interpretation of inline loads):

YesNoMapTemp:

load 0 as num, 'no' as str autogenerate 1;

load 1 as num, 'yes' as str autogenerate 1;

YesNoMap:

mapping load num, dual(str, num) resident YesNoMapTemp;

drop tables YesNoMapTemp;

MAP F1 USING YesNoMap;

t:

load 0 as F1, 'a' as F2 autogenerate 1;

load 1 as F1, 'b' as F2 autogenerate 1;

- Marcus

tomasz_l
New Contributor

Re: map using dual

Hi George,

It works, but it seems that you cannot directly use a field value - instead you should use a wrapping function returning values 0 and 1.

For example, during your load you should use


If(Shipped, 1, 0) as Shipped

     instead of

Shipped

--

Tomasz

Community Browser