Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QLIKWORLD LIVE! MAY 16 - 19TH, EARLY BIRD DISCOUNTS! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need a solution for REPLACE

So the data I was given has some spelling errors, so as a temporary fix I need to group the errors together until the system that holds the data is fixed.

Replace work for most of it until I came to abbreviations.

So the script is:

Replace(Replace(Replace(AccountGroup, 'Admininstration', 'Administration'),'Maint', 'Maintenance'), 'Mangemnt', 'Management')AS AccountGroup,

However I get a group called 'Maitenance', and a group called 'Maintenanceenance' since it is replacing the "Maint" of the correctly spelled group as well.

Is there an easy solution to fix this or another way of going about it?

Thanks,

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

FixTable:

mapping LOAD * INLINE [
    F1,F2
    Admininstration, Administration
    Mangemnt, Management
    Maint, Maintenance
]
;

Load
ApplyMap('FixTable',AccountGroup,AccountGroup) as AccountGroup
from yourqvd(qvd);

View solution in original post

3 Replies
Clever_Anjos
Employee
Employee

FixTable:

mapping LOAD * INLINE [
    F1,F2
    Admininstration, Administration
    Mangemnt, Management
    Maint, Maintenance
]
;

Load
ApplyMap('FixTable',AccountGroup,AccountGroup) as AccountGroup
from yourqvd(qvd);

Not applicable
Author

For anyone else who needs to use the answer above, to make it work you need to add the F2 column header to the table.

Thanks Anjos.

Clever_Anjos
Employee
Employee

Thank you for correcting me.

I´ve coded right into the answer box.

I should have used QV to code and test.