Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Adapting multiple records with underscore

Dear all,

I have two tables which I would like to link to one another, but one of them contains underscores and the other one does not.

NameAge
John Doe40
Peter Parker41
Jane Doe42

NameWeight
John_Doe50
Peter_Parker60
Jane_Doe70

I prefer not to change them one by one in the code in case new records are added.

What is the syntax for removing the underscores in the Qlik Sense data load editor?

Thanks for your help.

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

So here is a way to do it in Qlik Sense:

2015-05-06 #2.PNG

2015-05-06 #3.PNG

2015-05-06 #4.PNG

View solution in original post

9 Replies
datanibbler
Champion
Champion

Hi,

does QlikSense have the REPLACE() function?

If so, just replace BLANKs in that field with an underscore -> create a new field.

Then

- drop the old field using DROP FIELD ... FROM ...

- rename the new field to the old fieldname using RENAME FIELD ... TO ...

HTH

Not applicable
Author

Thanks for your reply, but unfortunately the Replace function is not supported by Qlik Sense.

datanibbler
Champion
Champion

Hi,

oops. That was dropped? Stupid ... well, then you can do it otherwise.

Do you have the Subfield() function?  Then you could try like

>> Subfield([name], ' ', 1) & '_' & Subfield([name], ' ', 2 <<

If that has been dropped, too - do you have the INDEX() function (to tell you the position of one character within a string?

Not applicable
Author

Hi,

thanks, the Subfield() function works and I understand what it does. Do you know how I should iterate through the data in order to apply this to every record in the name column?


petter
Partner - Champion III
Partner - Champion III

Replace function is still supported... both in scripts and charts/UI

Not applicable
Author

Are you sure? This is what I got when I entered Replace and clicked the question mark:

http://help.qlik.com/sense/en-US/online/#../Subsystems/Hub/Content/Scripting/QlikViewFunctionsStatem...

Replace                                    

This command is only relevant during partial reload, which is not supported in Qlik Sense.

I work with Qlik Sense 1.1 which I believe is the newest version. If you are sure it works I will try it out.

petter
Partner - Champion III
Partner - Champion III

There are two "Replace" keywords in script syntax:

- Replace() function

- Replace prefix to a Load statement

We are referring to the first - which is a function to replace parts of a string with some other string.

You are talking about REPLACE LOAD .... which is something entirely different ...

petter
Partner - Champion III
Partner - Champion III

So here is a way to do it in Qlik Sense:

2015-05-06 #2.PNG

2015-05-06 #3.PNG

2015-05-06 #4.PNG

Not applicable
Author

Thanks for your elaboration!