Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
knightwriter
Creator III
Creator III

Masking / scramble single data in the script

Hi All,

I am looking to mask single pieces of information in the script. ie hide a car owners name that does not want to be shown.

I am using the below in the script but I keep getting errors upon reload. Any suggestions on how to fix this and what Im doing wrong?

Load  * FROM qlikview.qvd

    If ([Car.Sales Owner] = 'John', 'Car Owner 123', [Car.Sales Owner]) As ([Car.Sales Owner])

1 Solution

Accepted Solutions
sinanozdemir
Specialist III
Specialist III

Nope, you should not be using it twice.

You need only one query:

LOAD

     column1, column2, column3,

     If ([Car.Sales Owner] = 'John', 'Car Owner 123', [Car.Sales Owner]) As ([Car.Sales Owner])

FROM

qlikview.qvd (qvd)

where [Car.Sales Owner Country] <> 'UK';

Or you can follow RoiUser suggestion as well if you don't want to re-type each column name in the load script:

load *,

      If ([Car.Sales Owner] = 'John', 'Car Owner 123', [Car.Sales Owner]) As [Car.Sales Owner1]

from qlikview.qvd (qvd)

where [Car.Sales Owner Country] <> 'UK';

drop field [Car.Sales Owner];

rename field [Car.Sales Owner1] to [Car.Sales Owner];


Hope this helps.

View solution in original post

6 Replies
sinanozdemir
Specialist III
Specialist III

If statement should be within LOAD script:

LOAD

     If ([Car.Sales Owner] = 'John', 'Car Owner 123', [Car.Sales Owner]) As ([Car.Sales Owner])

FROM qlikview.qvd

lironbaram
Partner - Master III
Partner - Master III

you should have something like this

load *,

      If ([Car.Sales Owner] = 'John', 'Car Owner 123', [Car.Sales Owner]) As [Car.Sales Owner1]

from qlikview.qvd (qvd);

drop field [Car.Sales Owner];

rename field [Car.Sales Owner1] to [Car.Sales Owner];

knightwriter
Creator III
Creator III
Author

Hi Sinan,

So in the previous line I have:

LOAD * FROM qlikview.qvd (qvd)

where [Car.Sales Owner Country] <> 'UK';

and have in the next line:

LOAD

     If ([Car.Sales Owner] = 'John', 'Car Owner 123', [Car.Sales Owner]) As ([Car.Sales Owner])

FROM qlikview.qvd (qvd);

ie I am using the same .qvd twice, is this incorrect? As the Load If statement is not working.

sinanozdemir
Specialist III
Specialist III

Nope, you should not be using it twice.

You need only one query:

LOAD

     column1, column2, column3,

     If ([Car.Sales Owner] = 'John', 'Car Owner 123', [Car.Sales Owner]) As ([Car.Sales Owner])

FROM

qlikview.qvd (qvd)

where [Car.Sales Owner Country] <> 'UK';

Or you can follow RoiUser suggestion as well if you don't want to re-type each column name in the load script:

load *,

      If ([Car.Sales Owner] = 'John', 'Car Owner 123', [Car.Sales Owner]) As [Car.Sales Owner1]

from qlikview.qvd (qvd)

where [Car.Sales Owner Country] <> 'UK';

drop field [Car.Sales Owner];

rename field [Car.Sales Owner1] to [Car.Sales Owner];


Hope this helps.

knightwriter
Creator III
Creator III
Author

Thanks for this update it has worked with the one query only

knightwriter
Creator III
Creator III
Author

Hi Liron,

Appreciate the response.This, with a combination from Sinan, worked very well.

Thanks again.