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

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
gmenoutis
Partner - Creator II
Partner - Creator II

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?

2 Replies
marcus_sommer
MVP
MVP

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
Contributor
Contributor

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