Ik probeer Twinfield tabel: ‘GeneralLedgerDetailsV3@tfd’ in te laden in Power BI. Het werkt als ik één jaar inlaad met de volgende m code in de advanced editor:
let
Source = OData.Feed("https://bridge-online.cloud/l-m-groep-twinfield/odata4", null, [Implementation="2.0", ODataVersion=4, OmitValues=ODataOmitValues.Nulls, Headers=[Referer = "doe het!" ], Timeout=#duration(0,4,0,0)]),
#"Twinfield.Twinfield.GeneralLedgerDetailsV3@tfd_table" = Source{[Name="Twinfield.Twinfield.GeneralLedgerDetailsV3@tfd",Signature="table"]}[Data],
#"Filtered Rows" = Table.SelectRows(#"Twinfield.Twinfield.GeneralLedgerDetailsV3@tfd_table", each ([FIN_TRS_HEAD_YEAR] = 2019) and [FIN_TRS_LINE_DIM1TYPE] = "PNL"),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"COMPANY_CODE", "COMPANY_NAME", "CODE", "NUMBER", "LINE", "FIN_TRS_HEAD_CURCODE", "FIN_TRS_HEAD_DATE", "FIN_TRS_HEAD_INPDATE", "FIN_TRS_HEAD_ORIGIN", "FIN_TRS_HEAD_PERIOD", "FIN_TRS_HEAD_STATUS", "FIN_TRS_HEAD_USERNAME", "FIN_TRS_HEAD_YEAR", "FIN_TRS_HEAD_YEARPERIOD", "FIN_TRS_LINE_BASEVALUESIGNED", "FIN_TRS_LINE_DEBITCREDIT", "FIN_TRS_LINE_DESCRIPTION", "FIN_TRS_LINE_DIM1", "FIN_TRS_LINE_DIM1GROUP1", "FIN_TRS_LINE_DIM1GROUP1NAME", "FIN_TRS_LINE_DIM1GROUP2", "FIN_TRS_LINE_DIM1GROUP2NAME", "FIN_TRS_LINE_DIM1GROUP3", "FIN_TRS_LINE_DIM1GROUP3NAME", "FIN_TRS_LINE_DIM1NAME", "FIN_TRS_LINE_DIM1GROUP4", "FIN_TRS_LINE_DIM1GROUP4NAME", "FIN_TRS_LINE_DIM1TYPE", "FIN_TRS_LINE_DIM2", "FIN_TRS_LINE_DIM2NAME", "FIN_TRS_LINE_DIM2TYPE", "FIN_TRS_LINE_VALUESIGNED", "FIN_TRS_LINE_VATBASEVALUESIGNED", "FIN_TRS_MNG_TYPE"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Other Columns",{{"CODE", "Trans.type"}, {"NUMBER", "Trans.no"}, {"FIN_TRS_HEAD_CURCODE", "Currency"}, {"FIN_TRS_HEAD_DATE", "trans.date"}, {"FIN_TRS_HEAD_USERNAME", "gebruiker"}, {"FIN_TRS_LINE_BASEVALUESIGNED", "value"}, {"FIN_TRS_LINE_DEBITCREDIT", "debit.credit"}, {"FIN_TRS_LINE_DESCRIPTION", "omschrijving"}, {"FIN_TRS_LINE_DIM1", "grootboekrekening"}, {"FIN_TRS_LINE_DIM1GROUP1", "grpcode1"}, {"FIN_TRS_LINE_DIM1GROUP1NAME", "grpname1"}, {"FIN_TRS_LINE_DIM1GROUP2", "grpcode2"}, {"FIN_TRS_LINE_DIM1GROUP2NAME", "grpname2"}, {"FIN_TRS_LINE_DIM1GROUP3", "grpcode3"}, {"FIN_TRS_LINE_DIM1GROUP3NAME", "grpname3"}, {"FIN_TRS_LINE_DIM1NAME", "grootboeknaam"}, {"FIN_TRS_LINE_DIM1GROUP4", "grpcode4"}, {"FIN_TRS_LINE_DIM1GROUP4NAME", "grpname4"}, {"FIN_TRS_LINE_DIM1TYPE", "dimensietype"}})
in
#"Renamed Columns"
Echter, als ik het filter op het jaar weghaal of als ik meerdere jaren filter gaat het mis. Dan krijg ik de error:
OLE DB- of ODBC-fout: [DataSource.Error] OData: Invalid JSON. A comma character ‘,’ was expected in scope ‘Array’. Every two elements in an array and properties of an object must be separated by commas…
Ik zie op het forum dat dit meerdere oorzaken kan hebben, maar ik heb niet kunnen achterhalen welke oorzaak het is bij mij.
Dit is een voorbeeld van een m code die niet werkt:
let
Source = OData.Feed("https://bridge-online.cloud/l-m-groep-twinfield/odata4", null, [Implementation="2.0", ODataVersion=4, OmitValues=ODataOmitValues.Nulls, Headers=[Referer = "doe het!" ], Timeout=#duration(0,4,0,0)]),
#"Twinfield.Twinfield.GeneralLedgerDetailsV3@tfd_table" = Source{[Name="Twinfield.Twinfield.GeneralLedgerDetailsV3@tfd",Signature="table"]}[Data],
#"Filtered Rows" = Table.SelectRows(#"Twinfield.Twinfield.GeneralLedgerDetailsV3@tfd_table", each ([FIN_TRS_HEAD_YEAR] = 2019) and [FIN_TRS_LINE_DIM1TYPE] = "PNL"),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"COMPANY_CODE", "COMPANY_NAME", "CODE", "NUMBER", "LINE", "FIN_TRS_HEAD_CURCODE", "FIN_TRS_HEAD_DATE", "FIN_TRS_HEAD_INPDATE", "FIN_TRS_HEAD_ORIGIN", "FIN_TRS_HEAD_PERIOD", "FIN_TRS_HEAD_STATUS", "FIN_TRS_HEAD_USERNAME", "FIN_TRS_HEAD_YEAR", "FIN_TRS_HEAD_YEARPERIOD", "FIN_TRS_LINE_BASEVALUESIGNED", "FIN_TRS_LINE_DEBITCREDIT", "FIN_TRS_LINE_DESCRIPTION", "FIN_TRS_LINE_DIM1", "FIN_TRS_LINE_DIM1GROUP1", "FIN_TRS_LINE_DIM1GROUP1NAME", "FIN_TRS_LINE_DIM1GROUP2", "FIN_TRS_LINE_DIM1GROUP2NAME", "FIN_TRS_LINE_DIM1GROUP3", "FIN_TRS_LINE_DIM1GROUP3NAME", "FIN_TRS_LINE_DIM1NAME", "FIN_TRS_LINE_DIM1GROUP4", "FIN_TRS_LINE_DIM1GROUP4NAME", "FIN_TRS_LINE_DIM1TYPE", "FIN_TRS_LINE_DIM2", "FIN_TRS_LINE_DIM2NAME", "FIN_TRS_LINE_DIM2TYPE", "FIN_TRS_LINE_VALUESIGNED", "FIN_TRS_LINE_VATBASEVALUESIGNED", "FIN_TRS_MNG_TYPE"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Other Columns",{{"CODE", "Trans.type"}, {"NUMBER", "Trans.no"}, {"FIN_TRS_HEAD_CURCODE", "Currency"}, {"FIN_TRS_HEAD_DATE", "trans.date"}, {"FIN_TRS_HEAD_USERNAME", "gebruiker"}, {"FIN_TRS_LINE_BASEVALUESIGNED", "value"}, {"FIN_TRS_LINE_DEBITCREDIT", "debit.credit"}, {"FIN_TRS_LINE_DESCRIPTION", "omschrijving"}, {"FIN_TRS_LINE_DIM1", "grootboekrekening"}, {"FIN_TRS_LINE_DIM1GROUP1", "grpcode1"}, {"FIN_TRS_LINE_DIM1GROUP1NAME", "grpname1"}, {"FIN_TRS_LINE_DIM1GROUP2", "grpcode2"}, {"FIN_TRS_LINE_DIM1GROUP2NAME", "grpname2"}, {"FIN_TRS_LINE_DIM1GROUP3", "grpcode3"}, {"FIN_TRS_LINE_DIM1GROUP3NAME", "grpname3"}, {"FIN_TRS_LINE_DIM1NAME", "grootboeknaam"}, {"FIN_TRS_LINE_DIM1GROUP4", "grpcode4"}, {"FIN_TRS_LINE_DIM1GROUP4NAME", "grpname4"}, {"FIN_TRS_LINE_DIM1TYPE", "dimensietype"}})
in
#"Renamed Columns"
Alvast bedankt voor de hulp!