Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Modify field value in a table

Hello and Happy New Year Experts,

I have a table like shown below:

marque:

load mid([Field0_], 5) as Désignation,

  [Field1_] as Emballage,

  [Field2_] as Contenu,

  [Field3_] as [Nb Cols],

  [Field4_] as [Nb Pals],

  [Field5_] as [Nb Litres]

resident ZSD_EGF_COMLIVSAISI

There is my problem: i wanna replace all the ',' by '.' in the column 'Contenu' but i don't know how to modify the value of this field.

It should be something like this:

replace([Field2_], ',', '.')

But this obviously don't work.

Can anyone help me for this?

Thanks for your replies,

Best Regards,

Loïc

1 Solution

Accepted Solutions
Not applicable
Author

Hi Ioic,

  Please find the attachment, may it helps you.

Santhosh G

View solution in original post

7 Replies
Not applicable
Author

Hi,

You can do the following:

marque:

load mid([Field0_], 5) as Désignation,

  [Field1_] as Emballage,

  [Field2_] as Contenu,

  [Field3_] as [Nb Cols],

  [Field4_] as [Nb Pals],

  [Field5_] as [Nb Litres]

resident ZSD_EGF_COMLIVSAISI;

Temp:

Load *,

Replace (Contenu,',','.') as Contenu_changed;

Hope this helps!

swuehl
MVP
MVP

What do you mean with 'obviously' don't work.

It should work, so please post some sample data so we can see the obvious.

salto
Specialist II
Specialist II

Hi,


replace([Field2_], ',', '.') as Contenu,


should do the work...

Not applicable
Author

Thanks for your replies!

The column 'Contenu' still has values like '0,200' so the content does not updated in the table

swuehl
MVP
MVP

Seems to work for me, only dots after replace:

marque:

load

  replace([Field2_],',','.') as Contenu

INLINE [

Field2_

",,.."

];

Are you trying to change a number format? Then look into the default format variables and num() function.

SET ThousandSep=',';

SET DecimalSep='.';

Not applicable
Author

Hi Ioic,

  Please find the attachment, may it helps you.

Santhosh G

Not applicable
Author

Thank you very much!

This is always easier to understand with an example