Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Applymap to replace multiple nested REPLACE ... possible?

Hi,

The Basic issue I face is the following: I have several Charts with some measure and the Dimension "cost Center". The names of the cost Centers vary very much in length which is somewhat annoying in a Chart. So I thought of nested REPLACE() functions first. That worked.

Then I tried to implement a partial reload to avoid loading other big tables whenever I had thought of something new for that "Abbreviation_algorithm", but that didn't work - the REPLACE keyword before the LOAD seems to interact in some way with those REPLACE() functions - I got the message "field names must be unique in a table" - without having changed anything ...

So next I tried to map all the fields. The "map ... using" did not work out though maybe that would do the trick:

- I have a Loop where I load all the qvd_files that exist within a given Directory, with the Name that's in the filename.

- Before that Loop I wrote >> MAP [field1], [field2], [field3], [field4] using [mappingtable]; << (I had loaded the mappingtable using an inline mapping_LOAD beforehand) and after the Loop I had an >> Unmap; <<.

<=> That did not have any effect whatsoever. Maybe that doesn't work with a loading_Loop - can I somehow make that work?

Anyway, I also tried just using four individual Applymap() commands in a separate RESIDENT LOAD - but that did not work either, probably because I always have the alternatives for the individual elements of a cost_Center_Name in the mappingtable, not the whole Thing ...

Any help here would be much appreciated - I think I have a solution for what I actually wanted for this, though - by renaming one of the qvd_files in that Directory, it doesn't match the filelist anymore, it is not loaded and the whole Thing is much faster - at least for when I want to work on the script. To work on the GUI, I have to load all the data again ...

Best regards,

DataNibbler

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Well, I haven't really understood your request, neither, but from reading the title, maybe look into

MapSubString() instead of ApplyMap() function.

View solution in original post

3 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Er ok.

How about you post some sample data. Show us your inputs and what you are looking to derive.

swuehl
MVP
MVP

Well, I haven't really understood your request, neither, but from reading the title, maybe look into

MapSubString() instead of ApplyMap() function.

datanibbler
Champion
Champion
Author

That's a good Approach, swuehl, possibly the right one, I'll have a look - what I want to replace (or map) is just substrings, elements of the Label, not the entire Label - that would be too much typework - example:

- Original Label is "Team Vergütungsabrechnung"

- I replace "Vergütungsabrechnung with "Verg.-abr." (I leave the word "Team" as it is)

=> The new Label reads "Team Verg.-abr."