Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
abalert
Contributor II
Contributor II

Replace values in field with the load script

Hi Experts,

I'm three weeks old for QlikView. I'm trying to LOAD data from ExcelSource and hopefully to get a result looks like TableAfter. It seems easy to do however still can't make it work from my Load Script,  please advise way(s?) to achieve this, thanks a lot!

 

ExcelSource

MemberIDGenderItem
T00001FShoes
T00002MTops
TS0001MBottom
TS0002MShoes
TS0003 Tops
T00007FBottom
TTT888 Bottom
TTT888 Shoes

 

TableAfter

MemberIDGenderNewItem
T00001FShoes
T00002MTops
TS0001StaffBottom
TS0002StaffShoes
TS0003StaffTops
T00007FBottom
TTT888NABottom
TTT888NAShoes

 

 

Labels (1)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Load
   *,
   If( Left(MemberID,2)= 'TS', 'Staff',
       if( Left(MemberID,3)= 'TTT' , 'NonMember', MemberID))    as NewGender
From <> ;

View solution in original post

4 Replies
tresesco
MVP
MVP

What is logic of deriving the new gender column? May be like:

- If( member id starts with 'TS', 'Staff',

           (if starts with 'TTT' , 'NA', as it is))               ??

abalert
Contributor II
Contributor II
Author

I think only two simple rules should apply,  thank you Tresesco!

 

member id starts with 'TS', 'Staff'

member id starts with 'TTT', 'NonMember'  //I think using the word NonMember will be better.

tresesco
MVP
MVP

Try like:

Load
   *,
   If( Left(MemberID,2)= 'TS', 'Staff',
       if( Left(MemberID,3)= 'TTT' , 'NonMember', MemberID))    as NewGender
From <> ;
abalert
Contributor II
Contributor II
Author

Really appreciated, that worked!

Now I know how to put two IF statements together, thank you Tresesco!