Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rename field with data from another field

Hi

I´m stucked on how to rename a field by using data (text) from fields in a diffrent table.

In table 'VUXSFI' I have the EGET1, EGET2, EGET3 and EGET4

In table 'EGENDEF' I have TEXT and NUMMER

There are no connection between them more then that I know that EGET1 has the value in TEXT corresponding to NUMMER A as header in the program.

EGET1 should therfore be renamed by using the text in 'EGENDEF' from field TEXT corresponding to value A in NUMMER

EGET1 = V13    (A)

EGET2 = V11    (B)

rename.jpg

1 Solution

Accepted Solutions
Not applicable
Author

Hi!

it for you

.rar   with qvw

View solution in original post

7 Replies
Not applicable
Author

I do not fully understand. But you did not try to load  with the type NUM(A) as EGET1

Load:

num(A) as EGET1

text(B) as EGET2

...

Not applicable
Author

Yes, If I do that I assaign the value and don´t rename the field.

The problem is that I want the field EGET1 to be renamed to the value in TEXT that are connected to A in field NUMMER

In the pictures I have selected a personID that in EGET1 has the value of 83.

In EGET2 = 146 and EGET3 = 6, EGET4 null

Insted of EGET1 the field should be named to V13 and still have the values stored in it.

EGET2 should be renamed to V11, EGET3 to H11 and EGET4 to HT12

The are no connections between the tables.

rename1.jpg

rename2.jpg

Not applicable
Author

oh. now understood. try  

Table1:

     load:...

     EGET1 ,

     'V13' as TEXT

     ...

     from ...(qvd);



concatenate Table1:

     load:

     ...

     EGET2 ,

     'V11' as TEXT

     ...

     from ...(qvd);




ETC.


     Load:

     number,

     TEXT

     From ...(qvd)



Not applicable
Author

Yes. That´s close to what I want but the values in TEXT will change yearly = I don´t want to change it manually but read the value from the TEXT in table egendef

edit. strange. the qvd:s have xml. remove that when you open

Not applicable
Author

can see only tomorow. But  uoy can use :

LOAD

RowNo() as ID,

     NUMMER,

     TEXT

FROM

(qvd);

//set q=;// in set must write max(ID)

for i=1 to 4 //q

Concatenate

TAble_test:

LOAD [AutoNumber(PERSONID)],

     'EGET'&$(i) , //there need write EGET$(i)  , but now not have time

     $(i)

FROM

(qvd);

Not applicable
Author

Hi!

it for you

.rar   with qvw

Not applicable
Author

A brilliant solution, you are my hero for the day!