Boolean data not outputting as expected
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a WF in which the very first tool out of the input file is a Select. A field in the file has data populated with true/false which the Select tool IDs the type as Bool and size as 1. The output from the Select tool for this field is true/false, not 1/0. The next tool is a multi-field, which sees the input as true/false and converts the field to V_String. The multi-field output becomes 1 / 0 but is also V_String. Downstream a formula tool had used that true/false in a conditional, which gave incorrect output since the data was 1/0. It took a while to troubleshoot and I've already updated the WF to account for this, but I'm very confused about 2 things:
First, why would the data type in that first select tool be bool but the output values remain as true/false, and then change to 1/0 only after conversion to V_String by the multi-field? Is this a bug or am I missing something about how this data is processed?
Second, the WF had worked fine for several months (meaning, the field had been true/false when it got to the downstream formula tool and processed as expected) before I noticed there was problem, so the only thing I can figure is either the data type in the input file had changed, or the first select tool had randomly flipped from V_String to bool for that field.
I am running Version: 2022.3.1.508 Patch: 4 for a several months and it is rather buggy so I am not ruling this out as the cause, has anyone has this experience of early select tools randomly flipping data types?
- Labels:
- Developer
- Developer Tools
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Rob48
I only guess that something changed in the input data. Open 2 input files one when it worked well and compare it to the current one.
For Boolean data type Alteryx will give 0 (for false) and -1 (for true). So if the data is True/False or 0/1 this is not from Alteryx unless you have a condition that force it to be True/False or 0/1.
Try to find a formula tool with IF statement that one argument is 1 or True and the other argument is 0 or False.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Further research on this today has added to my confusion. In an earlier version of my WF I had converted the bool field to V_String in a downstream select tool and the true/false data was maintained at output, so my formula tool read the expected 'false' in the conditional and processed the data correctly.
This makes zero sense to me unless it's a bug: why would changing bool to V_String in the multi-field tool convert the true/false input to 1/0 at output, but changing it in a select tool not have the same effect?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
and to respond to your comments:
- Open 2 input files one when it worked well and compare it to the current one - did it, no difference in the files or the WF processing
- For Boolean data type Alteryx will give 0 (for false) and -1 (for true). So if the data is True/False or 0/1 this is not from Alteryx unless you have a condition that force it to be True/False or 0/1. - the input was true/false from the source data. It remained as true/false until processed by the downstream multi-field which converted the output to 0 / 1, (not -1) which created the problem. The configuration in that multi-field was " [_CurrentField_] " as the expression and "Change Output type to" box checked with V_String selected
makes no sense to me unless i'm not understanding / using the multi-field tool correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How the Multi Field Formula tool is configured?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The multi field tool is used here to change the data type for multiple fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Right, it was one of the fields selected to change the data type.
