Products | Versions |
---|---|
Spotfire Statistica | 12.7 and later |
Text comparisons in Statistica spreadsheets for purposes of sorting and merging and other data operations are case insensitive by design. If you intend to merge data with case sensitive merge key, the HEX spreadsheet function could be used. When given text input, the HEX function returns a string containing the hexadecimal ASCII code of each individual character. For identical strings, HEX will produce the same output. For strings differing in case, HEX will produce different output. This may require sorting the output by the text fields when finished to bring items back together again in a more desirable order.
Here below is an example of such a use case in the workspace mode.
In this examples, two subsets from wheather Report example data are created by the subset node. The goal is to merge the two datasets by common variable "Date" and "Location" that distinguishes upper cases and lower cases. The value for "Date" and "Location" of the first two cases from both subsets are the same except that the subset2 has all lower cases for "Location" column.
1. In a workspace, click Data|Subset to create two subsets from the Wheather report spreadsheet and change first two cases of subset2 to have all lower cases in "Location" column (data preview as above).
2. Under Data tab, click "Transforms" to add it to Subset1 and then add another one for subset2,
3.Click the wheel icon on top left of the "Transformations of Variables" node to edit parameters for creating a new variable called "location_H" through"Hex" function for both subsets(If under Interactive mode, use spreadsheet formula to create the new variable through "Hex" function) and click "OK". e.g. Location_H=Hex(Location);
Note: you can click "Functions..." to search for the function details of "Hex".
4. After running the transform nodes, a new variable "Location_H" distinguishing upper case and lower case of the same Text is added to both subsets (e.g. Atlanta and atlanta).
5. Under Data tab, click Merge|Merge Variables to add "Merge Variables" node.
6. Click the wheel Icon to edit parameters for "Merge Variables" node and Match variables by "Date", "Location_H" and "Location".
7. After running the merge node, the final merged data will look like as below: