Prepare recipe Formula Question
I have a prepare formula, if FrameSize from the primary source is blank, use frame size from the other source. It works, unless both the primary and secondary source are '7F', in that case it changes to '7.0'. Can anyone see why?
Best Answer
-
AaronCrouch Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered, Dataiku Frontrunner Awards 2021 Winner, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant Posts: 18 ✭✭✭✭✭
I solved it. I took my initial formula, then added a step to replace values of "7.0" with "7F" directly after.
Answers
-
Hi,
If your data needs to be treated as a string in the formula, you can use strval("myColumnName"). Alternatively, if you want numeric, use numval("myColumnName"). Otherwise, your data type will be inferred, so 7F is inferred to a double 7.0.
Hope it helps,
Alex
-
AaronCrouch Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered, Dataiku Frontrunner Awards 2021 Winner, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant Posts: 18 ✭✭✭✭✭
Thanks for your reply.
After making the modification, now my field comes up as blank.
I also tried renaming the column so the column is created by my script. It still comes up blank.
-
Hi,
Could you please try again the previous solution, but this time with quotes "" inside strval:
if(isBlank(AT_FrameSize), strval("VP_FrameSize"), strval("AT_FrameSize"))
This will ensure it works for all values, not only 7F but any character values.
Cheers,
Alex