Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Kohli
Creator II
Creator II

TRIM(IF(SubField(BUYER,' ',1)='Mr.',REPLACE(BUYER,'Mr.',''),

Can you please explain the meaning for it:: TRIM(IF(SubField(BUYER,' ',1)='Mr.',REPLACE(BUYER,'Mr.',''),

    IF(SubField(BUYER,' ',1)='Mrs.',REPLACE(BUYER,'Mrs.',''),

    IF(SubField(BUYER,' ',1)='Ms.',REPLACE(BUYER,'Ms.',''),BUYER)))) AS BUYER,

2 Replies
ali_hijazi
Partner - Master II
Partner - Master II

subfield(column,delimer,1)

if the value of column is ABC EFG then the above function used as follows subfield(column_name, ' ',1) returns ABC

subfield_column_name, ' ' ,2) returns EFG

then the script is checking if the returned part contains Mr. or Ms. then replace these with empty string

I can walk on water when it freezes
big_dreams
Creator III
Creator III

Here you are Removing Mr. or Mrs. or Ms. from your data.

Subfield(Buyer,' ',1) -> return 1st value from Buyer field before space.

Regards,