"NULL" values converted to 'Underscore" when writing Spreadsheets to Database in TIBCO Statistica

"NULL" values converted to 'Underscore" when writing Spreadsheets to Database in TIBCO Statistica

book

Article ID: KB0075515

calendar_today

Updated On:

Products Versions
Spotfire Statistica All versions

Description

When running a Statistica Visual Basic (SVB) model in a workspace, that is pulling data from a SQL database, and writing a spreadsheet to database, NULL values are written as an underscore.

Issue/Introduction

This article discusses why NULLS are converted to an underscore when running a workspace that is writing a spreadsheet to a database

Resolution

As an example, consider the following sample of code where this issue is occurring:

MAN_LE_RD_LTV_GROUP_7_SECTOR_TYPE_GROUP=EvalExpr('ToString(MAN_LE_RD_LTV_GROUP_7)+ "_"+ToString(MAN_LE_RD_SECTOR_TYPE_GROUP)')

This piece of code concatenates 3 strings; where the middle item in the string concatenation is an underscore, i.e. "_".

If the variables to the left and right of this underscore are empty, the result will be a single underscore. However, if NULL is expected, then you would need to modify the rules to check for missing data (MD) in the following: MAN_LE_RD_LTV_GROUP_7 and MAN_LE_RD_SECTOR_TYPE_GROUP.

If both of these are missing data (MD), then you would need to set the resulting variable to an empty string.