Find more posts tagged with
Sort by:
1 - 2 of
21
Here my solution:
I used the "Set Macro"-operator to define a Macro with the name "number" and value "0".
I used the "Handle Exception"-operator. In the "Catch"-branch I put the "Set Macros"-operatur and give my macro "number" the value "1". In the "Try"-branch I did a "Loop attributes"-operator und used at the option "attribute filter type" the value "value_type" and the option "value type" I gave the value "numeric".
In the "Loop attributes"-operator I put a "Set macros"-operator and gave my macro "number" the value "2".
So if my dataset have numeric attributes, the macro "number" have the value "2", if not the macro "number" have the value "1".
I used the "Set Macro"-operator to define a Macro with the name "number" and value "0".
I used the "Handle Exception"-operator. In the "Catch"-branch I put the "Set Macros"-operatur and give my macro "number" the value "1". In the "Try"-branch I did a "Loop attributes"-operator und used at the option "attribute filter type" the value "value_type" and the option "value type" I gave the value "numeric".
In the "Loop attributes"-operator I put a "Set macros"-operator and gave my macro "number" the value "2".
So if my dataset have numeric attributes, the macro "number" have the value "2", if not the macro "number" have the value "1".
After the Numerical to Nominal operator one should use a Generate Attribute operator that generates eg. the isNum attribute with this function:
finds(%{macro_of_attribute_name},"^[0-9]+$") It returns true only if the value of the given attribute consists of only numbers.
And at the Branch operator the condition type should be 'attribute_value_filter', and the condition value 'isNum=true'.
It is not difficult but maybe there is a simliest way to do this. Is there?
Nice day!