Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a loaded gender field which contains the values M and F but I want to display those as Male and Female . Anyone has a suggestion about how to do this?
William,
yes you can ...
Gender:
LOAD
GENDER,
If(GENDER= 'F', 'Female', If(GENDER= 'M', 'Male','NN')) as NewGenderField,
GENDER_KEY
FROM
[..\QVD\GENDER.QVD] (qvd);
A good idea is to place this statement into the load script which produced the qvd file.
Rainer
Hi,
in your expression field, do the following =if(Gender = 'M', 'Male', if(Gender = 'F', 'Female', 'Unknown'))
Hope this help..
Regards,
Say Chao
Thanks, can I do this somehow in my loadscript?
Gender:
LOAD
GENDER,
GENDER_KEY
FROM
[..\QVD\GENDER.QVD] (qvd);
Hi William,
add the following line into your script:
If(YourFieldName = 'F', 'Female', If(YourFieldName = 'M', 'Male','NN')) as NewGenderField
So you will also find records where the values are not set.
Rainer
//Here is an example, you can paste it into a new QVW doc:
GenderTemp:
LOAD * INLINE [
gender
M
F
F
M
F
M
];
Gender:
Load If(gender='M','Male','Female') as Gender //conditional changing the field content
Resident GenderTemp;
Drop Table GenderTemp;
//Regards, C
William,
yes you can ...
Gender:
LOAD
GENDER,
If(GENDER= 'F', 'Female', If(GENDER= 'M', 'Male','NN')) as NewGenderField,
GENDER_KEY
FROM
[..\QVD\GENDER.QVD] (qvd);
A good idea is to place this statement into the load script which produced the qvd file.
Rainer
You guys are quick! Thanks for all the replies! I have used the solution of Rainer in the LOAD script which produces the qvd file and it works great!