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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Question about mapping

Hi,

Please i have a question about mapping

i have field called Activity

which has the values of 1,2,3,4

i want to represent them with names A,B,C,D

so i made mapping

LOAD * Inline

[

Activity , Name

1,A

2,B

3,C

4,D

];

when i select Name it reflects to the Activity

but when i used the Activity in the expression it doesn't reflect anything

hope the attached example clarify the problem

15 Replies
Jason_Michaelides
Partner - Master II
Partner - Master II

Sorry Mona - if you'd like to expand on what you are trying to achieve and why you're taking the approach you are then maybe we can help more.  I'm afraid I really don't understand what you're trying to do.  Does Stefan's expression above do it for you?

Jason

Not applicable
Author

Thanks Alot Stefan

it's working

but if u please explain what's meant by ch(39) as i can't undersatnd your expression

but it's working correctly,just i need to understand

swuehl
MVP
MVP

Mona,

the expression

'$(=concat(ActivityNew,chr(39)&','&chr(39)))'

will create a list of the comma separated ActivityNew values, each in quotes (chr(39) is calling the function to return ' with given ASCII code 39 for ' ). The list will then be taken as element_set by the set analysis expression, assigning the values to the field Activity.

I noted also that adding a DISTINCT before ActivitiyNew might be a bit more elegant.

Hope this solves your issue.

Regards,

Stefan

P.S: In cases like that, it might be good to spend a few words on your "big picture", this may allow to disregard some solutions upfront and may save some time

Jason_Michaelides
Partner - Master II
Partner - Master II

Nicely done Stefan

Mona - please make sure you credit Stefan for the answer by marking it as "correct".

Jason

swuehl
MVP
MVP

Just to add a note: I just found a much easier solution:

Sum({$<Activity= p(ActivityNew) >}Value)

Regards,

Stefan

Not applicable
Author

Thanks so much Stefan and Jason

i will try your second solution Stefan

Best Regards,

Mona