Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
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

Re: Replace not working

Why not just:

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

Resident Clean1;

View solution in original post

6 Replies

Re: Replace not working

Why not just:

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

Resident Clean1;

View solution in original post

Not applicable

Re: Replace not working

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

Re: Replace not working

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

Re: Replace not working

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

Re: Replace not working

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

Re: Replace not working

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