Skip to main content

I’m trying to return either 17 if the input is 17 o menos or 81 if the input is 81 o mayor.  Where did I go wrong?  Thank you in advance!

 

transform:    util.lookup
inputs:     17 o menos
 

table:
17 o menos:    17
81 o mayor:    81
fallback:     17 o menos
 

values:
1:
inputs:     17 o menos

@ImGoodAtAdsNotZaps (great user name by the way!)

 

This is not a good situation to use the lookup table function, instead you will want to use a spreadsheet-style formula where you put an if then statement. Replace the {{input}} with your input below, but here’s an example formula I would use in your situation:

if({{input}}>80, 81, if({{input}}<18, 17, {{input}}) )

This is a nested ifthen statement, and reads like the following (each new line is where a comma “,” appears)

  • if {{input}} is greater than 80
  • respond with 81
  • otherwise if {{input}} is less than 18
  • respond with 17
  • otherwise respond with the value of {{input}}

** Special note, spreadsheet-style formula only receives numbers as its input, if {{input}} contains something other than a number (ie: “45 Tall”) it will fail. If there is a possibility for the {{input}} to be something other than just a number use a formatter step before this step that extracts a number. and then use the output of that step as the {{input}} to this spreadsheet-style formula step. 


Thank you so much for the reply (and I’m glad you like the name!).  While the spreadsheet formula solution doesn’t work in this particular instance, I can see that being of use in the future!  This exercise strengthened by skills, though, as I learned how to use Text > Split Text at the first space.  Duh!  Thank you, again.


Ahh glad you figured it out! I totally misunderstood what you were trying to do! I thought 17 or less, but yeah splitting it on the first space will do exactly what you need! Good work at solving it!