Una famiglia di software per fogli di calcolo Microsoft con strumenti per l'analisi, la creazione di grafici e la comunicazione di dati
Adattandolo al tuo csv (attenzione a cambiare il percorso ed il nome del file)
let
Origine = Csv.Document(File.Contents("**C:\TEMP\esempip\_2.csv**"),[Delimiter=";", Columns=34, Encoding=1252, QuoteStyle=QuoteStyle.None]),
Intestazioni = Table.PromoteHeaders(Origine, [PromoteAllScalars=true]),
Formatta = Table.TransformColumnTypes(Intestazioni,{{"NOME", type text}, {"DATAASSUNZIONE", type date}, {"MATRICOLA", Int64.Type}, {"annomese", Int64.Type}, {"ANNO", Int64.Type}, {"MESE", Int64.Type}, {"TipoContratto", type text}, {"MIN\_GARAN", type number}, {"AVVIAM", type number}, {"MANT\_UPFRONT", type number}, {"MANT\_RUNNING", type number}, {"MANT\_SERVIZI", type number}, {"MANT\_VALORE", type number}, {"PR\_ACQUI", type number}, {"PR\_COMPOR", type number}, {"PR\_INCENT", type number}, {"PR\_BON\_FIRMA", Int64.Type}, {"PR\_BON\_FEDEL", Int64.Type}, {"ANTICIP\_RIMB", Int64.Type}, {"ALTRO", Int64.Type}, {"ACC\_FIRR", type number}, {"ACC\_ENASARCO", type number}, {"LIQ\_ISC\_PNC", type number}, {"LIQ\_FIRR", Int64.Type}, {"IVA", Int64.Type}, {"ImportoRA", type number}, {"ImportoEnasarco", type number}, {"IMP\_TOT\_CTRL", type number}, {"annomesedt", type date}, {"TOT\_FT\_LORDO", type number}, {"TOT\_FT\_NETTO", type number}, {"DataDimissioni", type date}, {"COD\_COORDINATORE", type text}, {"Coordinatore", type text}}),
tblOrder = Table.Sort(Formatta,{{"TOT\_FT\_NETTO", Order.Descending}, {"annomese", Order.Ascending}}),
Merge = Table.NestedJoin(Formatta, {"annomese"}, tblOrder, {"annomese"}, "tbl2", JoinKind.LeftOuter),
Rango = Table.AddColumn(Merge, "Rango", each List.PositionOf([tbl2][TOT\_FT\_NETTO], [TOT\_FT\_NETTO])+1),
Fine = Table.RemoveColumns(Rango,{"tbl2"})
in
Fine
Ciao.