View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
05490Bug reportsImport/Exportpublic2012-10-19 16:21
Reporteruser14164Assigned Tomdekker  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91+ 
Target Version2.00a2Fixed in Version2.00+ 
Summary05490: Spss export error in decimal values
Description

When exporting survey results for spss >16 the data file contain numbers with decimal like this "1.20" but after the import, the result in spss is "1.00" so we lost the decimal values.

For export under spss of decimal values please format the data file with coma as decimal separator and not point otherwise all decimal values are lost during import.

Steps To Reproduce

1) Create a survey with numeric data save with decimal values (default coma for decimal separator).
2) fullfill some survey with values : 1,20 ; 1,30 ; 1,40
3) Export results for spss >16
4) look values obtain after import : 1 ; 1 ; 1 (all decimal parts are lost)
5) edit data file and change '1.20';'1.30';'1.40' by '1,20' ; '1,30' ; '1,40' and reimport data into spss.
6) Now all decimal values are kept : '1,20' ; '1,30' ; '1,40'

TagsNo tags attached.
Attached Files
Bug heat10
Complete LimeSurvey version number (& build)121016
I will donate to the project if issue is resolvedNo
BrowserFirefox 4.0.1
Database type & versionmysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1
Server OS (if known)CentOS release 5.6 (Final)
Webserver software & version (if known)Apache/2.2.3
PHP VersionPHP 5.2.10

Relationships

related to 05792 closedTMSWhite Problem with comma separator for EM_validation 
related to 05524 closedTMSWhite matrix (text) + additionl option only numbers not working correct 
related to 06694 closedmdekker [SPSS Export] No numbers if matrix was used 

Users monitoring this issue

There are no users monitoring this issue.

Activities

user14164

2011-10-05 12:03

  ~16370

This temp fix present in export_data_functions.php must be applied in order to allow correct export to spss >=16 :

/*

  • Temp quick fix for replacing decimal dots with comma's
    if (my_is_numeric($strTemp)) {
    $strTemp = str_replace('.',',',$strTemp);
    }
    */
mdekker

mdekker

2011-10-10 13:11

reporter   ~16383

The decimal separator is an input specification that can be set for every language independently. The result in the database is always a decimal dot. If I remember correctly the SPSS input format depends on the set locale in SPSS and this can not be easily manipulated.

The only way to fix this is to make a switch for comma/dot in export that defaults to the format in the survey base language but maybe admin language makes more sense?

user14164

2011-10-10 13:43

  ~16384

Hello,

You're perfectly true.

But under spss 19, I try to change default settings for decimal separator between coma and point separator with no success.

Never mind, it could be great if the default separator could be linked with the default language LS is displaying it's interface:EN ".", FR ",".

Otherwise maybe it's possible to let the user choose the separator he wants to apply to it's spss export on the export data screen ?

Best regards,
Guillaume JAOUEN

mdekker

mdekker

2011-10-10 13:47

reporter   ~16385

I will see if it is possible to implement a switch that defaults to the current display language. Will report back here when I have a patch. As you already found the quickfix, I assume you are not in a hurry.

c_schmitz

c_schmitz

2012-01-23 16:54

administrator   ~16917

mdekker, maybe we can in the SPSS export screen just ask for the decimal mark (which would default to '.') ? Do you think you can implement such a new feature in the Yii version?

DWS

DWS

2012-03-09 14:37

reporter   ~17800

Hi,

I have the same problem when I export to SPSS, and the temp fix does not work for me. How I can use it?

Thanks.
Regards.

TMSWhite

TMSWhite

2012-03-09 16:28

reporter   ~17805

It's possible that this is fixed in 1.92. Internally, 1.92 now properly converts all numbers to using a period as the radix separator. When I export to SPSS, I'm seeing all of the values are accurate, and use the period as the decimal separator.

If you want SPSS to receive a comma separator, that conversion could be centralized as a last step before generating the CSV output for SPSS.

DWS

DWS

2012-03-12 10:58

reporter   ~17886

Last edited: 2012-03-12 12:10

Would be perfect, I work with statistical data and is very important to keep the entered values.
My version of SPSS (19) only accepts decimal values ​​separated by commas, whatever the locale. We changed all possible settings in SPSS but imported correctly only decimal values ​​separated by comma in .data file. If I change the values ​​manually in this file, the values ​​are imported correctly.

Anyway, now I have implemented the temp fix (see attached) and works fine.

Thanks.
Regards.

c_schmitz

c_schmitz

2012-07-27 10:29

administrator   ~20014

Last edited: 2012-07-27 10:29

Reminder sent to: mdekker

Menno, still up for it?

mdekker

mdekker

2012-08-14 13:54

reporter   ~20423

Time is very limited at the moment so no promises, but I will look into it now that the yii branch is nearly stable

c_schmitz

c_schmitz

2012-10-02 14:20

administrator   ~20979

Moving to development.

mdekker

mdekker

2012-10-17 11:31

reporter   ~21402

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=9907

mdekker

mdekker

2012-10-17 11:42

reporter   ~21403

Found a way to have SPSS handle the decimal separator on import.

c_schmitz

c_schmitz

2012-10-19 16:21

administrator   ~21493

New version 2.00+ Build 121019 released. Please update.

Related Changesets

LimeSurvey: master 6ee354e8

2012-10-17 02:30:37

mdekker

Details Diff
Fixed 05490: Spss export should now handle different decimal separator (locale) better Affected Issues
05490, 06694
mod - application/controllers/admin/export.php Diff File

Issue History

Date Modified Username Field Change
2011-10-04 18:52 user14164 New Issue
2011-10-04 18:53 user14164 Issue Monitored: user14164
2011-10-05 12:03 user14164 Note Added: 16370
2011-10-05 16:28 Mazi Assigned To => mdekker
2011-10-05 16:28 Mazi Status new => assigned
2011-10-10 13:11 mdekker Note Added: 16383
2011-10-10 13:43 user14164 Note Added: 16384
2011-10-10 13:47 mdekker Note Added: 16385
2012-01-23 16:54 c_schmitz Note Added: 16917
2012-01-23 16:54 c_schmitz Target Version => 2.00a2
2012-03-09 14:37 DWS Note Added: 17800
2012-03-09 16:28 TMSWhite Note Added: 17805
2012-03-09 16:29 TMSWhite Relationship added related to 05792
2012-03-09 17:29 TMSWhite Relationship added related to 05524
2012-03-12 10:58 DWS Note Added: 17886
2012-03-12 12:10 DWS Note Edited: 17886
2012-03-12 12:11 DWS File Added: export_data_functions.php
2012-07-27 10:29 c_schmitz Note Added: 20014
2012-07-27 10:29 c_schmitz Note Edited: 20014
2012-08-14 13:54 mdekker Note Added: 20423
2012-10-02 14:20 c_schmitz Note Added: 20979
2012-10-02 14:20 c_schmitz Project Bug reports => Development
2012-10-16 16:01 mdekker Relationship added related to 06694
2012-10-17 11:27 mdekker Project Development => Bug reports
2012-10-17 11:29 mdekker LimeSurvey build number 11026 => 121016
2012-10-17 11:31 mdekker Changeset attached => LimeSurvey master 6ee354e8
2012-10-17 11:31 mdekker Note Added: 21402
2012-10-17 11:31 mdekker Resolution open => fixed
2012-10-17 11:42 mdekker Note Added: 21403
2012-10-17 11:42 mdekker Status assigned => resolved
2012-10-17 11:42 mdekker Fixed in Version => 2.00+
2012-10-19 16:21 c_schmitz Note Added: 21493
2012-10-19 16:21 c_schmitz Status resolved => closed