Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewforum
Creator II
Creator II

How prefix value of applymap with some value

Imagine I have following value for the field called "Product".

Product
-------
Pen
Pencil
Eraser
Box


Account
------
XXX
YYY
ZZZ
PPP

I want use ApplyMap, if the value of product is Pencil then while using ApplyMap I need to Prefix the corresponding Account with AA.

For example if the Account value of Pencil is zzz then I want to prefix it with AA. So the value of ApplyMap field will be AAXXX.

Please help me on this...

14 Replies
Not applicable

use another applymap function to get the prefix (AA) and concatenate both apply maps

ex: applymap('Prefix',product,'NA') &applymap('mapacct',product,'NA')

MK_QSL
MVP
MVP

Can you provide AccountValue and Prefix for all the above products

qlikviewforum
Creator II
Creator II
Author

We need to prefix AA whatever account value is there. Please let me know if it is not understandable.

GGG --> AAGGGG

JJJ --> AAJJJ

Not applicable

if the prefix is not based on your product, just use 'AA'&applymap(.....) as fieldname.

qlikviewforum
Creator II
Creator II
Author

Thank you

But it should be only when the Produuct=Pencil and it is not for all. Hope it is clear now!

qlikviewforum
Creator II
Creator II
Author

Hi Manish,

Above is just the sample data to understand my requirement. I am little stuck with the logic and to implement this.

CELAMBARASAN
Partner - Champion
Partner - Champion

Use

Account & Applymap('ApplymapTable', Product)

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

=if(Product='pencil','AA','') & applymap('MyMap', Product)

-Rob

Not applicable

Hi,

Try this script

 

Map:

Mapping Load * Inline [
Product, Prefix
Pen, AA
Pencil, BB
Eraser, CC
Box, DD
]
;


Test:
Load * Inline [
Product, Account
Pen, XXX
Pencil, YYY
Eraser, ZZZ
Box, PPP
]
;

Result:
Load *,
ApplyMap('Map',Product)&Account as Result
Resident Test;

Drop Table Test;