Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replace with table vs Replace with inline

Guys....

Why this works:

Produto:

LOAD

          Id,

          Replace(Produto, 'Çaia','Saia') as Produto

FROM

(ooxml, embedded labels, table is Plan1);

And this doesn't work?

Temp:

LOAD * INLINE [

    Id, Produto

    1, Camiseta

    2, Calça Jeans

    3, Jaqueta

    4, Saia

    5, Çaia

];

Produto:

LOAD

          Id,

          Replace(Produto,'Çaia','Saia') as Produto

Resident Temp;

DROP Table Temp;

1 Solution

Accepted Solutions
Not applicable
Author

Hi Lorena,

You are loading the same fields second time and they are merging into once table, then you are dropping that table. so, you need to rename the fields in the resident load. Please find the attachment

Temp:

LOAD * INLINE [

    Id, Produto

    1, Camiseta

    2, Calça Jeans

    3, Jaqueta

    4, Saia

    5, Çaia

];

Produto:

LOAD

          Id as IdNew,

          Replace(Produto,'Çaia','Saia') as ProdutoNew

Resident Temp;

DROP Table Temp;

View solution in original post

6 Replies
jpenuliar
Partner - Specialist III
Partner - Specialist III

You need to add NoConcatenate before Produto:

jpenuliar
Partner - Specialist III
Partner - Specialist III

or Rename

Produto:

LOAD

          Id as newID,

          Replace(Produto,'Çaia','Saia') as NewProduto

Resident Temp;

jpenuliar
Partner - Specialist III
Partner - Specialist III

What is Happening is before the script drop Temp table,

Temp and Produto are Concatenated.

If you comment Drop Table Temp and see in Table viewer (CTRL+T), Temp table is doubled

Not applicable
Author

Hi Lorena,

You are loading the same fields second time and they are merging into once table, then you are dropping that table. so, you need to rename the fields in the resident load. Please find the attachment

Temp:

LOAD * INLINE [

    Id, Produto

    1, Camiseta

    2, Calça Jeans

    3, Jaqueta

    4, Saia

    5, Çaia

];

Produto:

LOAD

          Id as IdNew,

          Replace(Produto,'Çaia','Saia') as ProdutoNew

Resident Temp;

DROP Table Temp;

Anonymous
Not applicable
Author

hi,

try:

Temp:

LOAD * INLINE [

Id, Produto

1, Camiseta

2, Calça Jeans

3, Jaqueta

4, Saia

5, Çaia

]
;

NoConcatenate

Produto:

LOAD

Id,

Replace(Produto,'Çaia','Saia') as Produto

Resident Temp;
DROP Table Temp

Regards

Neetha

Not applicable
Author

Thank Guys!! ❤️