How to connect Power BI to PostgreSQL - postgresql

I want get data into Power BI desktop from PostgreSQL (on my local machine). I tried the solution given here (Installing ngpsql to use PostgreSQL in PowerBI), but it did not work.
Basically, I installed the latest version of ngpsql(3.2.4) with the option to install to GAC. However, I'm getting the same error in Power BI saying that the connector requires one or more additional components.
Am I missing any steps? I looked online but did not find any recent documentation on this.
Any help is very much appreciated.
Thanks

Three ways :
1 - The ngpsql way does work if your follow the comment of Lavande:
Install npgsql as Administrator (since the DLL would be pushed to GAC);
During the installation stage, enabled "Npgsql GAC Installation";
Restart the PC
2 - With ODBC, i used this walk-through
install ODBC connector here
start it and create a new connection (DSN)
in Power BI, get data, ODBC,PostGreSQL, no options
enter the credentials.
select the table(s) of interest.
3 - With the M query language.
Nota : the Power BI community posts ? well, ...

Another option to solve this problem is to create a Python script to connect to Postgresql.
Using a script like this:
import psycopg2
import pandas as pd
con = psycopg2.connect(host='localhost', database='Your DataBase',
user='user', password='password')
cur = con.cursor()
cur.execute('Your Query')
data = cur.fetchall()
df = pd.DataFrame(data, columns=['Your Columns'])

Related

Configure Stata 16 to work with Postgres WRDS Database on a Apple Silicon Mac

I am currently trying to run some Stata code related to the WRDS database for my Ph.D. It is a postgres database requiring some configuration via ODBC. While isql connection via Terminal works, the command odbc list in Stata returns the following error:
The ODBC file libodbc.dylib could not be found on this system. Setting the unix LD_LIBRARY_PATH environment variable may correct this error.
I mainly followed the tutorial on https://gist.github.com/JonathanWillitts/7b5a519bd40dd730b98ce1ad75e859e8, trying to adapt it to the Postgres requirements for the Database via homebrew and psqlodbc. I assume the error comes from the variable export via Terminal that I use:
export LD_LIBRARY_PATH=/opt/homebrew/lib/ && /Applications/Stata/StataSE.app/Contents/MacOS/StataSE &
I have had success downloading WRDS data into R using the RPostgres package.
If you do not figure out how to download WRDS data directly into Stata, a possible workaround is to:
Use R and the RPostgres package, and download the data into R
Then export the data from R into Stata, see:
https://www.statmethods.net/input/exportingdata.html
https://datascienceplus.com/exporting-data-from-r/
I am happy to share R code for obtaining WRDS data. Let me know if this interest you and I can share my R code here.

Mongo BI Connector to SpreadSheet

I have mongoDB & MongoBI connector installed & configured. Want to check whether the BI Connector is working with a client.
In my case, want to use BI Connector with SpreadSheet. I am using the following URL - https://docs.mongodb.com/bi-connector/master/connect/excel/
Able to get till Step# 5 (Select Your DSN), as per the document. When I click next I don't see any database (or) table to select. Stuck after step# 5.
Any idea? Need some suggestions/help.
select your created DSN.and you can use it
The issue is with 32 bit versus 64-bit driver. In my case, I was using excel 32 bit & mongo driver installed was 64-bit.
After installing the right Mongo Driver version -> recreate DSN -> follow the steps as per docs -> it worked like a charm :-)
Hope it helpful

IBM DB2 ON AS400

I want to configure IBM DB2 on iseries AS400. The issue is I'm not getting the proper tool for AS400 and I've already installed Data Studio for configure DB2.
I don't have any knowledge regarding AS400 and I'm fresher for IBM technology.
I have already ODBC drivers of iseries. Please help me to find out iseries AS400 setup tool.
DB2 is integrated into OS/400 and all of it's following OS's. To configure DB2 on these platforms, perform a power-on maneuver. If it is already turned on, then DB2 is configured.
BTW, you probably don't have an AS400 but something newer. The hardware is likely Power System or Pure System, and the OS is likely IBM i.
Once you get a SQL connection to the AS400 aka system i aka iseries. Configure the DB by executing this SQL statement in Studio.
create collection myas400SQL
This will create an as400 library named MYAS400SQL that has the mumbo jumbo journal automatically added meaning this will work like every other SQL database with commit rollback transactions...
Lets try it.
CREATE TABLE myas400sql.mytable (myfield char(1))
Table mytable can handle commits and rollbacks like any other db you may have used.
Happy Friday.

How to Connect Mongodb to tableau

We are still in the development phase.
Our req is parse the XML to JSON and store them as flat files in Mongodb
Then for the analysis we want to use tableau.
Part 1 of the req is done...now i need to connect to tableau.
Versions we have are
Mongo 3.2
Tableau 9.1
I have googled and couldn't find any steps to integrate tableau with mongodb.
I also saw Mongodb has released a connector but there is no Windows BI connector.
Now do we need to migrate to Enterprise version for tableau connectivity.
Many thanks for the inputs
Detailed Instructions (for Windows), using localhost server of mongoDB:
1) Installation: Install Tableau, MongoDB, and MongoDB BI Connector for Tableau.
2) From the command prompt, you will want to serve your mongoDB instance as well as the mongoDB_sql server needed to connect to Tableau MongoDB BI Connector. Add mongoDB and mongoDB BI Connector bin's to your system path, for example: C:\Program Files\MongoDB\Server\3.6\bin\ and 2) C:\Program Files\MongoDB\Connector for BI\2.3\bin\.
3) Serve your local mongoDB server. Example command: mongod. (Let's assume it is served on localhost:27017.
4) Create a schema of the database you want Tableau to integrate with. Command to do this: mongodrdl --out <path_that_you_want_to_save_schema_to> /db:<name_of_database>
5) Validate the schema, and serve your local server of mongoDB as an SQL server (Tableau expects this server to be running). Command to do this: mongosqld --schema <path_to_schema> (** this will typically serve to localhost:3307)
6) You can now go to Tableau, under connectors, click on the MongoDB BI Connector, and enter localhost for the server, and 3307 for the port. (assuming in step 5 you have validated that the sql server is running on localhost with port 3307).
I hope this helps, these exact steps worked well for me.
The mongo biconnector is implemented as a multicorn (python) based Foreign Data Wrapper imbedded in the supplied postgresql server. Tools are provided to set up the postgresql "biuser" user, to create the collection to table mappings from data sampling, and to import the resultant schema into postgresql. The postgresql database contains non-materialized views corresponding to the (flattened) mongo collections. Access is through the postgresql server using standard postgresql jdbc/odbc drivers.
I think run mongodb bi connector in docker ubuntu/centos is a choice if the connector does not support windows, and tableau does not support linux, that's a question.
There is an example of create bi connection in www.mongodb.com/tableau with mongosqld
Hope this would work well for your issue
I have described our way connecting to data in MongoDB Community Edition to Tableau. First creat an API to your DB, then Web Data Connector to Tableau (it's HTML and JS files), after you can use WDC Connector in Tableau to connect to your URL.
Here is the detailed description how we did it: https://medium.com/#katya.neulinger/tableau-web-data-connector-to-mongodb-c1477d7d5ac9

SQL linked server with filemaker

I have a client with FileMaker Pro 11 Advanced.
I need to be able to connect to the filemaker database via SQL. I am using MS SQL Server 2008 R2, or Server 2012 can be used.
These are the steps I have tried
0) Turned on ODBC/JDBC sharing in File -> Sharing on FileMaker Pro 11 Advanced for "All Users"
1) installed the FileMaker OBDC driver included on the filemaker disc
2) odbcad32.exe in C:\Windows\SysWOW64 and added a new filemaker System DSN and directed it to the filemaker database.
3) Attempted to add a linked server to SQL using Provider Microsoft OLE DB Provider for OBDC Drivers and the System DSN name i created for Data Source. I left all other fields blank.
I get this error:
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "FILEMAKER2".
OLE DB provider "MSDASQL" for linked server "FILEMAKER2" returned message "[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application". (Microsoft SQL Server, Error: 7303)
FILEMAKER2 is the what i called the System DSN.
What am I doing wrong/What do I need to correct in order to connect to filemaker with SQL?
Is there a connection string to put in for Provider String?
I have the same mismatch error trying to do a test connect with access.
Thank you for any help.
The error you're getting is because of the driver installed is a 32bit driver propably on a 64bit system.
Look in the downloads of FM for the correct xbit driver.
I've connected to FM using ODBC from PHP apps to do basic inserts, updates, deletes of data. I haven't worked with it like you're attempting to do, though, and like #ted said, FM really wasn't built as a SQL platform.
Their answer to this was to go the other way around. You can setup External SQL sources within FileMaker, and bind your SQL database to FM so that those tables show up in FM the same as regular FM tables. These tables can then be used within FM scripts accordingly, so you could setup any data sync steps necessary there. You could create scripts to move data from FM layouts into the SQL DB layouts at given intervals throughout the day, for example.
Hope that helps.
FileMaker 11 only comes with a 32 bit ODBC driver. The error you got happens when you use a 32 bit driver with the 64 bit ODBC admin utility. Set up your DSN using the 32 bit utility, found here:
C:\Windows\SysWOW64\odbcad32.exe
...and it will work fine.