- Posts: 43
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to retrieve Limesurvey (version 3.x) data from Power BI desktop on Windows
- mcovents
- Topic Author
- Offline
- Senior Member
1) - Install Python www.python.org/downloads/windows/
- Install Git for Windows git-scm.com/download/win
Leave the default settings. Allow both installation programs to set the PATH environment variables.
- Run a Command prompt by clicking on the Windows icon and type "cmd". Click on the "Run as Administrator" option on the right.
- Check if Git is installed by running the line below in this command prompt
git --version
This should print the version (for example git version 2.31.1.windows.1)
- Check if Python in installed by running
py -- version
This should print the version (for example Python 3.9.1)
2) Run the following in the command prompt (copy each line and press enter after each):
pip install pandas requests matplotlib
pip install git+https://github.com/ESchae/limesurveyrc2api
3) - Download the script (limesurvey-powerbi.py) from Adam Zammit
github.com/adamzammit/limesurvey-powerbi-python
- Update the script to include your LimeSurvey JSON-RPC URL (Configuration - Global settings - Interfaces), username, password and survey id
line 8 upto 11
- Make sure the JSON-RPC interface is enabled on your Limesurvey installation.
4) Run the script from the Power BI desktop using Data Import then "Python Script"
If you get an error <pi>KeyError: 'Token'</pi> this means that the name of the field "Token" in the surveydata table on which the script is trying to merge the data is different on your Limesurvey installation. For example in my language (dutch) it was 'Toegangscode'. I had to change line 39
Old line
mergeddata = tokendata.merge(right=surveydata,how='outer',left_on='token',right_on='Token')
New line
mergeddata = tokendata.merge(right=surveydata,how='outer',left_on='token',right_on='Toegangscode')
- holch
- Offline
- LimeSurvey Community Team
- Posts: 11658
- Thank you received: 2742
I think the best place for this would be in the manual.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
- DenisChenu
- Away
- LimeSurvey Community Team
- Posts: 13647
- Thank you received: 2491
I don't think we need to create part for «How to install python on windows» for example …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
- pgaljan
- Offline
- New Member
- Posts: 2
- Thank you received: 1
This being my first time trying this, I'm not sure where I should start troubleshooting. I've reinstalled numpy, and installed mkl-service via pip.
Any ideas you have as to where to look next would be very much appreciated!
Details: "ADO.NET: Python script error.
<pi>C:\Users\<user>\anaconda3\lib\site-packages\numpy\__init__.py:143: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see github.com/IntelPython/mkl-service
from . import _distributor_init
Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 2, in <module>
import os, pandas, matplotlib
File "C:\Users\<user>\anaconda3\lib\site-packages\pandas\__init__.py", line 16, in <module>
raise ImportError(
ImportError: Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.8 from "C:\Users\<user>\anaconda3\python.exe"
* The NumPy version is: "1.20.1"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.
</pi>"
- pgaljan
- Offline
- New Member
- Posts: 2
- Thank you received: 1