Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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])
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.
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
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];
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.
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.
Thanks for this update it has worked with the one query only
Hi Liron,
Appreciate the response.This, with a combination from Sinan, worked very well.
Thanks again.