Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Applmap() does not bring correct results in some instances

Hi all,

I am familiar with the function but have encountered one strange issue with the ApplyMap function I like a lot. Suddenly it does not link correctly two exactly the same values in the mapping load and load fact for some lines. For example, if I check values created I get this:

CodeFile

"AB-1234" "Description 1234"

"AC-4321" "Description 4321"

Fact

ApplyMap('CodeFile', 'AB-1234', '<Empty>') returns Description BUT ApplyMap('CodeFile', 'AC-4321', '<Empty>') returns <Empty>.

I need to say that those CodeFiles and Facts are loaded into one QV table from the year dependent tables, i.e. CodeFile11 and CodeFile12 and Fact11 and Fact12. I tried to include Year into to key but then it didn't work at all. I've also tried to use text() and trim(text()) but no luck.


I am still on the version 9 SR4.

Thanks for ideas,

Nenad

1 Solution

Accepted Solutions
Not applicable

Re: Applmap() does not bring correct results in some instances

Do not bother. I've sorted it out

As I have two for...next loops I had to add a Year variable to the name of the mapping loads. For example: mapping load Other_Map$(Y)$(vC): and then add a Year into the key like here '$(Y)-$(vC)-'&Field1 as OtherID, and then use the same notation in the ApplyMap function, applymap('Other_Map$(Y)$(vC)', '$(Y)-$(vC)-'&Field2, '<Empty>')

2 Replies

Re: Applmap() does not bring correct results in some instances

Hi Nenad,

Two quick questions: is there any chance that fact or codefile tables are being concatented implicitly but unexpectedly? And this leads to the second: is there any change that there is more than one description for one given CodeFile?

Hope that helps.

Miguel

Not applicable

Re: Applmap() does not bring correct results in some instances

Do not bother. I've sorted it out

As I have two for...next loops I had to add a Year variable to the name of the mapping loads. For example: mapping load Other_Map$(Y)$(vC): and then add a Year into the key like here '$(Y)-$(vC)-'&Field1 as OtherID, and then use the same notation in the ApplyMap function, applymap('Other_Map$(Y)$(vC)', '$(Y)-$(vC)-'&Field2, '<Empty>')

Community Browser