Create a data connector for SPSS Data Source (SAV)
11 Comments
- Hugoberry314Regular VisitorFor anyone landing here from a search while this idea waits for votes: there is a way to read .sav files in Power Query today with nothing installed. I wrote a pure M reader for SPSS system files: https://github.com/Hugoberry/powerquery-driverless/tree/main/spss It is plain M source. Paste it into a blank query named Spss.Document, then: let Source = File.Contents("C:\data\survey.sav"), Doc = Spss.Document(Source), Data = Doc{[Name = "Data"]}[Data] in Data No R, no Python interpreter, no ODBC driver, no admin rights. Because there is no script host involved, it also refreshes in the Service. On the labels problem several people raised above: that was the part I cared about most. The result is a navigation table with three rows. Data is the cases. Variables is the dictionary (name, variable label, type, format, measurement level, user-missing declarations). ValueLabels is one row per variable/value/label, so the code lists arrive as a table you can join or use as a lookup dimension. If you want the labels in place of the codes instead: Spss.Document(Source, [ApplyValueLabels = true]) and to treat user-missing values as null the way SPSS does in analysis: Spss.Document(Source, [UserMissingToNull = true]) It handles uncompressed and bytecode-compressed .sav plus .zsav, long variable names, string variables wider than 255 bytes, and the SPSS date/time formats. The limitations are in the README: big-endian and EBCDIC files raise a clear error, case weights are reported but not applied, and the whole file is buffered, so it suits survey-sized files rather than multi-GB extracts. The decode is verified cell by cell against pyreadstat/ReadStat, the same engine behind R's haven. The same repo has readers for Stata .dta, dBASE/FoxPro, Access, SQLite and others on the same no-install principle.
- fbcideas_migusrNew MemberStatus added:Needs Votes
- davidc1New MemberI don't understand why this hasn't been done a long time ago. Microsoft wants us to move from apps like Stata and SPSS, yet there is no easy way to bring pre-coded data (data that is categorized). IBM Statistics (formerly SPSS Base) is an app that offers all data to be easily coded with labels to correspond with its values. For example, it is trivial to set for the Variable "Overall_Satisfaction" to set the following parameters: 1 - Not satisfied at all 2 - Slightly satisfied 3 - Mostly satisfied 4 - Satisfied 5 - Extremely satisfied It is not clear how to bring in labels that would correspond to values in Power BI. Surely there must be people at Microsoft who are doing market research and dealing with coded variables in their studies. I would switch from SPSS in a second if I could import an SPSS file and keep the value labels intact with each variable and corresponding values.
- amitjzaveri1New MemberSPSS data can be imported using Python script. Please visit this blog for detailed steps https://amitzaveri.com/2020/06/04/import-spss-file-in-to-power-bi-using-python-savreaderwriter-library/
- rohini_avadhanaNew MemberCreate a Data Connector for SPSS format files
- pking1New MemberThe fundamental problem is the labels. Importing data is easy. Importing variable and value labels is really really hard. I use a lot of categorical data and without labels any dashboard is meaningless.
- marta_659New MemberHi everyone, j I tried via R , but it doesnt work, show me this error: Detalles: "ADO.NET: R script error. Error in rxImport(inData = spssFile, outFile = tempFile, overwrite = TRUE) : no se pudo encontrar la función "rxImport" Ejecución interrumpida Could someone help me please? thanks
- c_vandijkNew MemberHello, I have tried this one, but get a failure... Details: ADO.NET: R-scriptfout. Error in doTryCatch(return(expr), name, parentenv, handler) : Could not open data source. Calls: rxImport ... tryCatch -> tryCatchList -> tryCatchOne -> doTryCatch -> .Call Execution halted I have installed Windows R client en R Studio. Do you know a solution? I have no experience with R. Greetings Charel
- jennie_fimbres1New MemberWould like a connector for SPSS with Power BI
- barendnu1New MemberActually, via R, there is a possibility to at least load SPSS data. Unfortunately, variable labels seem to be lost, so I vote for Microsoft to build a data connector, but this is a way to get data from SPSS to Power BI: # 1. Install R http://aka.ms/rclient/download # 2. Install Microsoft R Client https://msdn.microsoft.com/en-us/microsoft-r/r-client-get-started # 3. Now go to PowerBI, go to Get data > More > Other > R script and copy/paste this R script: spssFile <- file.path("d:\\yourpath\\yourfile.sav"); tempFile <- "c:\\temp\\temp.xdf"; tempData <- rxImport(inData = spssFile, outFile = tempFile, overwrite=TRUE); spssData <- rxFactors(inData=tempData, sortLevels=TRUE,factorInfo=c("weegvar")); # In the first line, be sure to enter the path to your SPSS file and use double slashes (\\) # In the last line, enter a variable in your dataset to sort on # Reference and more info: https://msdn.microsoft.com/en-us/microsoft-r/scaler-user-guide-data-import
Recent ideas
Data Pipelines - Run only selected activities
For debugging and testing pipeline activities during development, allow us to select one or multiple activities and run only the selected pipeline activities. For example, I'm working on editing ...frithjof_v22 hours agoCommunity ChampionNew618Views11likes2CommentsSemantic model connection bindings should be in source control (Git)
Semantic model data source connection bindings should be source controlled. A semantic model can contain multiple data source references, each of which can be mapped to a separate Fabric data connec...frithjof_v1 day agoCommunity ChampionNew21Views1like0CommentsBulk changing column names in Visualizations Pane
We often use raw/api column names or measures with a set nomenclature to be consistent and to keep track of them but we do not want to display these names in the visuals. Currently we have to change ...vishal1401971 day agoFrequent VisitorNew6Views0likes0Comments