Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

Microsoft 365 Convertir CSV en tableau de nombres

guigui4901

XLDnaute Junior
Bonjour Le forum

Me revoilà à nouveau bloqué sur Excel...

Mon outil métier n'est franchement pas simple à gérer (Merci Oracle) et il me complique la tâche.

Je fais une extraction jour par jour de mes données stats mais les chiffres sont importés en tant que texte. Or, je n'arrive pas à les convertir en nombre.
J'ai tenté avec la formule VALEURNOMBRE mais il ne prends pas en compte la virgule et me donne donc un résultat en dizaine de milliards... puisque mon logiciel extrait une dizaine de chiffres après la virgule (inutile d'ailleurs pour du monétaire mais bon...)

Pouvez-vous m'expliquer comment modifier les valeurs ? Y a t'il une formule qui remplace le " . " par une virgule ce qui permet à excel de détecter le nombre ?

En PJ deux fichiers : le csv (mais il y a beaucoup de colonnes, c'est peut-être galère à utiliser) et l'import excel ou j'ai fait le tri des colonnes utiles.

Je suis preneur de la méthodologie tant qu'à faire car j'ai d'autres sites à exporter...

Merci pour votre aide,

A très vite

Guillaume
 

Pièces jointes

  • VERSION EXCELµ.xlsx
    31.3 KB · Affichages: 3
  • history_forecast364840069.txt
    134 KB · Affichages: 3

vgendron

XLDnaute Barbatruc
Hello

dans ta requete PQ, il manque juste une étape dans laquelle tu remplaces le . par ,

chez moi ca donne ceci
VB:
let
    Source = Csv.Document(File.Contents("C:\Users\vince\Downloads\history_forecast364840069.txt"),[Delimiter=";", Columns=55, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"En-têtes promus" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Type modifié" = Table.TransformColumnTypes(#"En-têtes promus",{{"GPAGEID", type text}, {"REC_TYPE", type text}, {"REC_TYPE_DESC", type text}, {"SUMNO_ROOMSPERREC_TYPE", Int64.Type}, {"SUMCALC_OCCROOMSPERREC_TYPE", Int64.Type}, {"SUMCALC_INVROOMSPERREC_TYPE", Int64.Type}, {"SUMARRIVAL_ROOMSPERREC_TYPE", Int64.Type}, {"SUMCOMPLIMENTARY_ROOMSPERREC_T", Int64.Type}, {"SUMHOUSE_USE_ROOMSPERREC_TYPE", Int64.Type}, {"SUMDAY_USE_ROOMSPERREC_TYPE", Int64.Type}, {"SUMNO_SHOW_ROOMSPERREC_TYPE", Int64.Type}, {"SUMIND_DEDUCT_ROOMSPERREC_TYPE", Int64.Type}, {"SUMIND_NON_DEDUCT_ROOMSPERREC_", Int64.Type}, {"SUMGRP_DEDUCT_ROOMSPERREC_TYPE", Int64.Type}, {"SUMGRP_NON_DEDUCT_ROOMSPERREC_", Int64.Type}, {"SUMDEPARTURE_ROOMSPERREC_TYPE", Int64.Type}, {"SUMOOO_ROOMSPERREC_TYPE", Int64.Type}, {"SUMNO_PERSONSPERREC_TYPE", Int64.Type}, {"SUMINVENTORY_ROOMSPERREC_TYPE", Int64.Type}, {"SUMREVENUEPERREC_TYPE", type text}, {"SUMOWNER_ROOMSPERREC_TYPE", Int64.Type}, {"SUMFF_ROOMSPERREC_TYPE", Int64.Type}, {"CF_AVERAGE_ROOM_RATE_REC_TYPE", type text}, {"CF_OCCUPANCY_REC_TYPE", type text}, {"REVENUE", type text}, {"NO_ROOMS", Int64.Type}, {"IND_DEDUCT_ROOMS", Int64.Type}, {"IND_NON_DEDUCT_ROOMS", Int64.Type}, {"GRP_DEDUCT_ROOMS", Int64.Type}, {"GRP_NON_DEDUCT_ROOMS", Int64.Type}, {"NO_PERSONS", Int64.Type}, {"ARRIVAL_ROOMS", Int64.Type}, {"DEPARTURE_ROOMS", Int64.Type}, {"COMPLIMENTARY_ROOMS", Int64.Type}, {"HOUSE_USE_ROOMS", Int64.Type}, {"DAY_USE_ROOMS", Int64.Type}, {"NO_SHOW_ROOMS", Int64.Type}, {"INVENTORY_ROOMS", Int64.Type}, {"CONSIDERED_DATE", type date}, {"CHAR_CONSIDERED_DATE", type text}, {"IND_DEDUCT_REVENUE", type text}, {"IND_NON_DEDUCT_REVENUE", Int64.Type}, {"GRP_NON_DEDUCT_REVENUE", Int64.Type}, {"GRP_DEDUCT_REVENUE", type text}, {"OWNER_ROOMS", Int64.Type}, {"FF_ROOMS", Int64.Type}, {"CF_OOO_ROOMS", Int64.Type}, {"CF_CALC_OCC_ROOMS", Int64.Type}, {"CF_CALC_INV_ROOMS", Int64.Type}, {"CF_AVERAGE_ROOM_RATE", type text}, {"CF_OCCUPANCY", type text}, {"CF_IND_DED_REV", type text}, {"CF_IND_NON_DED_REV", Int64.Type}, {"CF_BLK_DED_REV", type text}, {"CF_BLK_NON_DED_REV", Int64.Type}}),
    #"Autres colonnes supprimées" = Table.SelectColumns(#"Type modifié",{"REVENUE", "NO_ROOMS", "NO_PERSONS", "CONSIDERED_DATE"}),
    #"Colonnes permutées" = Table.ReorderColumns(#"Autres colonnes supprimées",{"CONSIDERED_DATE", "REVENUE", "NO_ROOMS", "NO_PERSONS"}),
    #"Valeur remplacée" = Table.ReplaceValue(#"Colonnes permutées",".",",",Replacer.ReplaceText,{"REVENUE"}),
    #"Type modifié1" = Table.TransformColumnTypes(#"Valeur remplacée",{{"REVENUE", type number}})
in
    #"Type modifié1"
 

guigui4901

XLDnaute Junior
Merci beaucoup

Bonne fin de journée ....
 

Discussions similaires

Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…