Forum Discussion
CSV file not uploading new rows automatically
I tried to load the same file which I am using currently and it was loaded with the right number of rows: However, when I pasted the advanced editor query code of the previous file in it, tHe number of rows for the new data file also got reduced to 3236 as the old one. Despite the fact that previously it loaded "8379" actual rows. Below is the code:
let
Source = Csv.Document(File.Contents("E:\data\automation\contact sample.CSV"),[Delimiter=",", Columns=88, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"DENTER", type text}, {"COUNTRY", type text}, {"YRONSET", Int64.Type}, {"PROVINCE", type text}, {"PCODE", type text}, {"DISTRICT", type text}, {"DCODE", Int64.Type}, {"GCODE", Int64.Type}, {"TEHSIL", type text}, {"TCODE", Int64.Type}, {"UC", type text}, {"UCODE", Int64.Type}, {"MP", type text}, {"MPTYPE", type text}, {"OTMPOP", type text}, {"SERIALD", Int64.Type}, {"EPID", type text}, {"URGENT", type text}, {"NAME", type text}, {"ADDRESS", type text}, {"SEX", type text}, {"DOB", type text}, {"AGE", Int64.Type}, {"FLANG", type text}, {"OLANG", type text}, {"DONSET", type text}, {"MTHONSET", type text}, {"WKONSET", type text}, {"DNOT", type text}, {"DOI", type text}, {"NOTBY", type text}, {"TYPESITE", type text}, {"DOSESR", type text}, {"EPICARD", type text}, {"DOSESN", type text}, {"DOSES", Int64.Type}, {"VDOSES", type text}, {"DOSESL6", type text}, {"RMDOSES", type text}, {"ORMDOSES", type text}, {"DLOPV", type text}, {"IPVDOSE", type text}, {"DSTOOL1", type text}, {"DSTOOL2", type text}, {"DSTSENT1", type text}, {"DSTSENT2", type text}, {"ADEQ", type text}, {"FEVER", type text}, {"ASYM", type text}, {"PROGRESS", type text}, {"PDIAG", type text}, {"CONTACT", type text}, {"ELIGCONT", type text}, {"INADAFP", type text}, {"URGHARD", type text}, {"URGINSEC", type text}, {"SPECCONC", type text}, {"OTHREAS", type text}, {"SOTHREAS", type text}, {"WILDCONT", type text}, {"VDPVCONT", type text}, {"DCRES", type text}, {"DIRES", type text}, {"LABNO", Int64.Type}, {"DSTLAB1", type text}, {"DSTLAB2", type text}, {"STCOND1", Int64.Type}, {"STCOND2", type text}, {"L20B", Int64.Type}, {"P11", Int64.Type}, {"P12", type text}, {"P1", Int64.Type}, {"P21", Int64.Type}, {"P22", type text}, {"P2", Int64.Type}, {"P31", Int64.Type}, {"P32", type text}, {"P3", Int64.Type}, {"ENTERO1", Int64.Type}, {"ENTERO2", type text}, {"ENTERO", Int64.Type}, {"DFUP", type text}, {"FUP", type text}, {"ERC", type text}, {"CLASS", type text}, {"DIAG", type text}, {"OTHER", type text}, {"", type text}}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "EPID", Splitter.SplitTextByDelimiter("-", QuoteStyle.None), {"EPID.1", "EPID.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"EPID.1", type text}, {"EPID.2", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"EPID.1", "EPID"}, {"EPID.2", "contact_#"}}),
#"Changed Type2" = Table.TransformColumnTypes(#"Renamed Columns",{{"DSTOOL1", type date}}),
#"Removed Errors" = Table.RemoveRowsWithErrors(#"Changed Type2", {"DSTOOL1"}),
#"Changed Type3" = Table.TransformColumnTypes(#"Removed Errors",{{"DSTOOL1", type text}})
in
#"Changed Type3"
Can someone please guide me where is the issue here? Because the source file old and new are same and both have 8379 rows