Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dkbhatt51
Contributor III
Contributor III

To change field_value

I searched the tags in the community discussions but could not get a clue. I would appreaciate any help on the following:

I have two fields X and Y as below:

     X               Y

VISIT 1
VISIT 3
VISIT 1Yes
VISIT 3Yes

I want to change the Field X value to 1a and 3a (as applicable) if Field Y value = Yes. I know I can use InputField function but it becomes tedious to manually change the large data set.

Many thanks in advance

Darshan

6 Replies
suniljain
Master
Master

you can do only at script level during load of data .

dkbhatt51
Contributor III
Contributor III
Author

Thanks Sunil - Agreed.

Can  it be done without changing the source data? If so how?

Darshan

Not applicable

Hope it helps!

Load X,

       Y,

       if(Y='Yes',X&'a') AS NewX

From TableName.xls

dkbhatt51
Contributor III
Contributor III
Author

if I use the At titude's script it creates another field NewX.

I therefore tried

Load X,
       Y,
       if(Y='Yes',X&'a')as X

and it worked fine

Thanks.

Not applicable

Hey

Yours is incorrect! You cannot give same column name for two or more fields from same table. That's the reason I have named it as NewX for your understanding. So the answer which I have given is correct.

Please let me know if you have any questions.

Thanks,

Attitude

dkbhatt51
Contributor III
Contributor III
Author

Hi,

In a hurry I typed wrong - sorry about that.

The following syntax wroks for me:

T1:

Load X,

        Y

From abc.xls

T2:

Load Y,

     

         if(Y='Yes', X&'a') as X resident T1;