Community Conundrum 25:Feature Visualization is now live! Read More

Prepare recipe Formula Question

Level 2
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?

 

Capture.PNG

4 Replies
Dataiker
Dataiker

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 

Level 2
Author

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.

Level 2
Author

I solved it. I took my initial formula, then added a step to replace values of "7.0" with "7F" directly after.

Dataiker
Dataiker

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