I've got an absolutely horrible dataset in Excel (13,500 variables, a lot of them irrelevant to my purposes). I need to analyse in SPSS as I have a lot of data transformations to do... but SPSS 24 struggles with a dataset that size. Well... either SPSS struggles, or my work PC does.
Is there a way, when importing data from Excel, to import multiple ranges? Specifically, I want Column A (my unique identifier), then several other ranges (e.g. G:AC, DD:JJ, etc.).
/CELLRANGE=RANGE only seems to allow a single range.
If you have the appropriate ODBC driver for Excel, you can use the database reading facility in Statistics to select the fields. However, the catch with ODBC and Office is that the bigness has to match. If both are 32-bit, that's easy, but 64-bit Statistics would need 64-bit Office, and that's a world of hurt.
No (you can't specify multiple ranges), is the short answer. What you ought to be doing is importing the entire relevant range and then using SPSS commands to manipulate as you desire. For example using ADD FILES FILE with DROP sub command to delete irrelevant columns/variables.
I don't know of a way to directly import multiple ranges from Excel. You might try importing the file to an MS Access database first, then read the table from the database to SPSS using (in SPSS) "open database" --> "new query". The query editor will let you specify the fields you want to import.
Related
My company is using BI Publisher for some data dumps and I know BI Publisher isn't really designed for that, but this is what I have to use.
I have two files with over 100 fields each. Is there a way to add every field to the report or do I have to add each field individually?
If you have an data model export, you could use the BIP designer in word to add a table, and select multiple fields to the output. The wizard will do the xdo code for you.
Use E-Text output. It is designed for EFT (Electronic Fund Transfers) in Payment module. But you can use it to export a CSV (Comma Separated Value) file, or a fixed width file. Both of which can be opened in Excel. The E-Text output is fully documented in the BI Publisher user guides. Some advanced stuff is a bit harder to accomplish, but it is not terribly difficult. A simple CSV file should be quick and easy to create. You will need to list every field, there's no "give me everything" command.
It's actually to your benefit to use those for larger data extracts, when you you use the Word RTF tables, the output Excel files are VERY large due to the way BI Publisher formats the cells.
Is it possible to created a Stored Procedure in SAS Enterprise Guide and allow the user to enter in a list of values, without having to manually enter in the list?
I use more Base SAS than EG, so I'm not an expert on Stored Procedures. Currently, an analyst in my area may have to search for a list of values like so:
012345678
123456789
231456789
091236574
439857345
120129038
230918239
....
....
N
and is using a Stored Procedure that was built to enter in these values. However, this is not efficient as this last can be >40 values, and SAS will only allow you to enter in one at a time.
I've been messing around with the prompt manager for an hour or so and haven't had any luck. I've also tried 'User selects from a static list', using an excel doc that I imported. Which worked great ad-hoc, but, because the values will always be different, I can't figure out how to make EG first import this excel doc, then bring up the prompt for her to select all the (new) values, then run the rest of the program.
Also, it seems that I would have to change the 'Static Value List' in the prompt manager every time the doc was imported, even if the rest of the program was conditioned on the import of the excel doc. I'm going to continue playing around with this, but looking for ideas as to if anyone has done this previously.
Sounds like you want "select multiple values from a dynamic list". I suggest you read the excel file that holds all the response options into a SAS dataset. Then register that dataset in the SAS metadata server. When you create a dynamic prompt you point to the source SAS dataset that holds the response options. After creating the prompt, you can update the dataset any time you want (add/delete records), and then STP user will see those updated response options in the prompts.
It may also be possible to register an Excel file in metadata instead of reading it into a SAS dataset. But I always try to limit Excel usage as much as possible.
I want to put different custom tables to different sheets in Excel. I tried with OMS and OUTPUT EXPORT but that functions not do what I want. If somebody have idea I hope that will help me. :)
OUTPUT EXPORT has an OPERATION subcommand with options CREATEFILE / CREATESHEET / MODIFYSHEET from which you can route CTABLES to desired sheets in a target/new Excel file.
You'll need to organise your OUTPUT documents as you wish your sheets.
Exorting to Excel using OMS you can not route to a specific sheet only with OUTPUT EXPORT you can.
OUTPUT EXPORT can write different sheets, but it doesn't give you much flexibiity in the objects that get exported when using it via syntax. The syntax mode assumes that you are not going to be interactively selecting the tables.
However, the SPSSINC OUTPUT MODIFY extension command includes a customoutputfunctions.py module that has an excelexport function that will do what you want. Here is an example. For more information see the SPSSINC OUTPUT MODIFY documentation or the dialog (on Utilities once installed). Then look at the examples in the customoutputfunctions.py module.
SPSSINC MODIFY OUTPUT TABLES
/IF SUBTYPE="'Custom Table'" PROCESS=ALL
/CUSTOM FUNCTION="customoutputfunctions.excelexport(file='c:/temp/extest.xls',
sheet='table#',action='CreateWorksheet')".
I'm pulling small statistics or bunch of product-data from my erp system from irb-console to excel.
For example some product data:
Product.where(active:true, sale:false).map{|p| [p.sku, p.name, p.stock_amount].join("\t")}.each{|s| puts s}
the output can be copied and pasted directly to excel. This is the shortest I found for my self. Is there a way with less typing get this done?
What database are you using? Most databases like Postgresql have a COPY command that allows you to export an active record query filled with data to a csv file which can be opened and resaved as an excel file. This is probably the fastest and most convenient way as you start to work with larger data-sets.
I have hundreds of SPSS .sav files. For each one I want to extract the variable NAMES and variable LABELS as a two column table to a csv file. I know that this is straightforward by simply copying and pasting from the "Variable view" window, but I would really like to know how to do this using syntax. Is this possible?
Many thanks in advance for any help!
You might be interested in the GATHERMD extension command, It takes a wildcard for the file names and builds a dataset with three variables: the file name, the variable name, and the variable label. You could then just save that as a csv file.
This command requires the Python Essentials available with your Statistics installation or via the SPSS Community website (www.ibm.com/developerworks/spssdevcentral).
Using native Statistics syntax, DISPLAY DICTIONARY and CODEBOOK might be helpful, but they won't give you all this information in one table.