Best answer

Lookup Table Help

  • 29 June 2020
  • 3 replies
  • 150 views

Userlevel 1

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

icon

Best answer by PaulKortman 29 June 2020, 20:45

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +10

@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. 

Userlevel 1

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.

Userlevel 7
Badge +10

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!