Forum Discussion

Spigaw's avatar
Spigaw
Icon for Helper III rankHelper III
4 years ago
Solved

Change locale of select values in a Table.TransformColumnTypes()

Hello,

 

I have to import many .csv files, in which I have € values with a period (.) separator. Problem is, I am in France, so the locale does not recognize it as a number.

I know I can add steps to change the locale then convert it to float, but I wondered if there is a way to change the locale of one or more values in a Table.TransformColumnTypes(), but not all.

 

In my example, I need to have "Débit" and "Crédit" in en-US format, and keep the other ones in fr-FR:

= Table.TransformColumnTypes(#"Colonne de tables développée1",{{"Source.Name", type text}, {"Compte", Int64.Type}, {"Libellé compte", type text}, {"Code rubrique caisse", type text}, {"Libellé rubrique", type text}, {"Matricule", Int64.Type}, {"MatriculeRH", Int64.Type}, {"Nom", type text}, {"Prénom", type text}, {"Date du dernier calcul paie", type datetime}, {"Code société", Int64.Type}, {"Code établissement", Int64.Type}, {"Débit", type text}, {"Crédit", type text}})

 

Thanks in advance for any help!

  • No. You'd need a second transformation for those specifically. The Table.TransFormColumnTypes accepts a culture settings for the entire function, not for individual items in the list of fields.

     

    Table.TransformColumnTypes(table as table, typeTransformations as list, optional culture as nullable text)

1 Reply

  • edhans's avatar
    edhans
    Icon for Community Champion rankCommunity Champion

    No. You'd need a second transformation for those specifically. The Table.TransFormColumnTypes accepts a culture settings for the entire function, not for individual items in the list of fields.

     

    Table.TransformColumnTypes(table as table, typeTransformations as list, optional culture as nullable text)