Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replace not working

If field SalAccount is 'N/A', i would like to have it replaced by the value of field Corporate Account, else leaved unchanged. I have written this script

LOAD IF([SalAccount]='N/A', Replace([SalAccount], 'N/A', [Corporate Account]), [SalAccount]) as [Sales Account]

Resident Clean1;

this is not working.

do you have an idea ?

1 Solution

Accepted Solutions
Nicole-Smith

Why not just:

LOAD IF([SalAccount]='N/A', [Corporate Account], [SalAccount]) as [Sales Account]

Resident Clean1;

View solution in original post

6 Replies
Nicole-Smith

Why not just:

LOAD IF([SalAccount]='N/A', [Corporate Account], [SalAccount]) as [Sales Account]

Resident Clean1;

Not applicable
Author

thanks! much more simple

my whole script is

CleanUpMap:

mapping load * inline [

x, y

'LTD.', 'LIMITED'

'LTD', 'LIMITED'

];

Clean1:

LOAD Country,

     [Corporate Account],

     [Sales Account]  as [Sal Account],

     MapSubString('CleanUpMap',[Blg acc]) as [Billing Account]

Resident accountInfo;

LOAD IF([Sal Account]='N/A', [Corporate Account], [Sal Account]) as [Sales Account]

Resident Clean1;

Clean up in Clean1 is performed, but not the one in the LOAD IF

Nicole-Smith

You need to post data and a .qvw along with an explanation of what you're getting vs. what you're expecting to get if you want more help with this.

Not applicable
Author

data are confidential and would need rework before post. thanks anyway

Nicole-Smith

Take a look at this post.  It will help you to figure out what you can do to your document in order to post it on here while keeping your data confidential: Preparing examples for Upload - Reduction and Data Scrambling

Nicole-Smith

I also suggest you read through this post thoroughly: QlikCommunity Tip: How to get answers to your post?