Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

dkbhatt51
New 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

Tags (1)
6 Replies
suniljain
Honored Contributor

Re: To change field_value

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

dkbhatt51
New Contributor III

Re: To change field_value

Thanks Sunil - Agreed.

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

Darshan

Not applicable

Re: To change field_value

Hope it helps!

Load X,

       Y,

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

From TableName.xls

dkbhatt51
New Contributor III

Re: To change field_value

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

Re: To change field_value

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
New Contributor III

Re: To change field_value

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;

Community Browser