Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Mods ReplaceValuesTransformation does not allow replacement of (Empty) values #149

Open
nikomaresco-csg opened this issue Jun 27, 2024 · 0 comments

Comments

@nikomaresco-csg
Copy link

nikomaresco-csg commented Jun 27, 2024

in Spotfire Analyst, i'm able to create a new Replace Values transformation, leave the "Previous value" field blank, and enter any data type into the "Replace value with" field:

image

this allows me to replace (Empty) (or as it's shown here, (Empty value)) with a new value.

reproducing this with the Action Mods API is not possible. the following code fails with the error below:

const t = new ReplaceValuesTransformation(columnToReplace, null, 0);
Error: The argument newValue must have the same data type as the column, in this case String
Parameter name: newValue
    at createReplaceValuesTransform (C:\Users\...\.js:72:15) ->     const t = new ReplaceValuesTransformation(columnSignature, null, newValue);

this is repeatable with the following values: null, undefined, (Empty)

as a workaround, i was able to use the SN() function in a ReplaceColumnTransformation:

const t = new ReplaceColumnTransformation(columnToReplace, resultColumnName, "Real(SN([Value], '0'))";

if this workaround is the desired path, it should be mentioned in the documentation for ReplaceValuesTransformation. otherwise, there should be a way to indicate (Empty) in either the originalValue or newValue parameter.

https://spotfiresoftware.github.io/spotfire-mods/api-docs/action-mods/classes/Spotfire.Dxp.Data.Transformations.ReplaceColumnTransformation.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant