Forum Discussion
Dbf bulk query
Good morning, I am still trying to create bulk connection for tables in DBF and am not able to find a solution, to see if anyone can help me a little
I have an excel with a list of branches, in column F of that excel I have the names of each one of the databases that I need to bring.
You would have to do a query that opens protruding, goes through column F (compute that over time), and overrides the base name in the query path.
As I imagine:
load locales.xlsx
for i Locals row
BASE - Column 7.Fila
Let
Source: OleDb.DataSource ("Microsoft.ACE.OLEDB.12.0 Provider; Data Source: C: - Users, matiasvizzari, Documents, Lynx, (BASE), DBF, DBF; extended properties: dBASE IV",
[Query: "select * from [ctb.dbf]"])
next i
In
I am sorry for the horrors in the example of how I imagine it, but it is because I have no idea how to correctly identify it.
From already thank you very much,
Cheers
Good morning, I have already been able to solve the problem, if someone can help you, watching tutorials and reading about power query I found that having a reference excel and generating a GetData function for each of the necessary tables, I was able to bring from all the bases the tables and combine them into one, this is perhaps too punctual, I needed them agreed, but I share it in case someone ever serves it even if it is for reference
Getdata table Cli.dbf(Nlocal)=> let Origen = Excel.Workbook(File.Contents("C:\Users\administrador.ESTANCIAS\Documents\Power BI Desktop\Sucursales.xlsx"), null, true), Sheet1_Sheet = Origen{[Item="Sheet1",Kind="Sheet"]}[Data], LOCAL = Sheet1_Sheet{Nlocal}[Column9], Source = OleDb.DataSource("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Z:\LINCEV3\"&LOCAL&"\DBF\;extended properties=dBASE IV", [Query="select * from [cli.dbf]"]) in Sourcethe excel that is called in the query has an ID per database, the name of the database and the name of the directory folder that has the database
ex: 1 Castelar caste
Query calling Getdatalet Origen = Excel.Workbook(File.Contents("C:\Users\administrador.ESTANCIAS\Documents\Power BI Desktop\Sucursales.xlsx"), null, true), Sheet1_Sheet = Origen{[Item="Sheet1",Kind="Sheet"]}[Data], #"Encabezados promovidos1" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]), #"Tipo cambiado" = Table.TransformColumnTypes(#"Encabezados promovidos1",{{"UBICACIÓN", type text}, {"AGRUPAMIENTO", type any}, {"NOMBRE_LOCAL", type any}, {"NOMBRE_LOCAL_TOTAL", type any}, {"COD_LOCAL", Int64.Type}, {"CONCEPTO", type text}, {"SSS", type text}, {"TIPO", type text}, {"LOCAL", type text}, {"Activo", Int64.Type}, {"Orden", Int64.Type}}), #"Personalizada agregada" = Table.AddColumn(#"Tipo cambiado", "Personalizado", each GetData([COD_LOCAL])), #"Otras columnas quitadas" = Table.SelectColumns(#"Personalizada agregada",{"COD_LOCAL", "Personalizado"}) in #"Otras columnas quitadas"
I hope I have not made it very confusing, thank you all very much,
Cheers.
3 Replies
- v-juanli-msftCommunity Support
You could refre to the following guides:
https://www.youtube.com/watch?v=qdcAoZU8B8Q
https://www.youtube.com/watch?v=BrMHv6zVsrI
Best Regards
Maggie
- MatiasVizzariHelper I
Good morning, I have already been able to solve the problem, if someone can help you, watching tutorials and reading about power query I found that having a reference excel and generating a GetData function for each of the necessary tables, I was able to bring from all the bases the tables and combine them into one, this is perhaps too punctual, I needed them agreed, but I share it in case someone ever serves it even if it is for reference
Getdata table Cli.dbf(Nlocal)=> let Origen = Excel.Workbook(File.Contents("C:\Users\administrador.ESTANCIAS\Documents\Power BI Desktop\Sucursales.xlsx"), null, true), Sheet1_Sheet = Origen{[Item="Sheet1",Kind="Sheet"]}[Data], LOCAL = Sheet1_Sheet{Nlocal}[Column9], Source = OleDb.DataSource("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Z:\LINCEV3\"&LOCAL&"\DBF\;extended properties=dBASE IV", [Query="select * from [cli.dbf]"]) in Sourcethe excel that is called in the query has an ID per database, the name of the database and the name of the directory folder that has the database
ex: 1 Castelar caste
Query calling Getdatalet Origen = Excel.Workbook(File.Contents("C:\Users\administrador.ESTANCIAS\Documents\Power BI Desktop\Sucursales.xlsx"), null, true), Sheet1_Sheet = Origen{[Item="Sheet1",Kind="Sheet"]}[Data], #"Encabezados promovidos1" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]), #"Tipo cambiado" = Table.TransformColumnTypes(#"Encabezados promovidos1",{{"UBICACIÓN", type text}, {"AGRUPAMIENTO", type any}, {"NOMBRE_LOCAL", type any}, {"NOMBRE_LOCAL_TOTAL", type any}, {"COD_LOCAL", Int64.Type}, {"CONCEPTO", type text}, {"SSS", type text}, {"TIPO", type text}, {"LOCAL", type text}, {"Activo", Int64.Type}, {"Orden", Int64.Type}}), #"Personalizada agregada" = Table.AddColumn(#"Tipo cambiado", "Personalizado", each GetData([COD_LOCAL])), #"Otras columnas quitadas" = Table.SelectColumns(#"Personalizada agregada",{"COD_LOCAL", "Personalizado"}) in #"Otras columnas quitadas"
I hope I have not made it very confusing, thank you all very much,
Cheers.- gustavoleoAdvocate II
The only chance that you have to work with DBF files on Power BI is
using Devart OCBC Driver here -->> https://go.helpbi.com/dbf and Power BI Dataflows
First, create a Dataflows and then on another dataflow( if you have premium per user) make all the data mashup on a reference Entities /Table.
If you don't have a premium, make your transformations on Desktop from your DBF converted to a Power BI Dataflows