Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
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
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
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

Partner
Partner

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];

Creator III
Creator III

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.

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

Creator III
Creator III

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

Creator III
Creator III

Hi Liron,

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

Thanks again.