Input field checking
I have 2 input fields - date in Unicode format. How could I compare the two fields and output a Boolean value? Then, I will use that Boolean value as the condition for loops. Also, how can I implement logic like If-else statement using connectors? I just see the while loops. Many thanks.
-
It is possible to compare the string values but you may want to convert the data type of the fields to 'date' type before performing the comparison - you can use the Modify Fields to perform the data type conversions.
You can then use the Calculate Field node to perform the date field comparison and create the boolean value for the result.
Alternatively, you can use the Transform node and some Python scripting to perform the comparison. The Calculate Fields node provides defaults for the situation where a field value is Null but in the Transform case you will need to add code to handle this situation.
See the attached data flow for the above use cases.
You can use the Meta Check node to create tests for various conditions e.g. whether the expected fields exist in the input data; min / max number of fields; min/ max number of input records. The success action and terminus action setting can be used, in conjunction with run dependencies (clocks) to create conditional execution of sub-flows within the data flow. For further information see the 'Node help' > 'Metadata and structure' > 'Meta Check' topic in your Analyze Help documentation (alternatively see the topic for the latest version of the product here) and also the 'Advanced topics' > 'Creating run dependencies' topic (online here) and 'Advanced topics' > 'Creating run dependencies' > 'Conditional execution' topic (online here)
Attached files
Please sign in to leave a comment.
Comments
2 comments