Possible IF Statement Help

  • 1
  • Question
  • Updated 3 years ago
  • Answered

I creating a report so I can calculate the Total Price of minute usage. I was able to create a UI-Only field and use this formula:

({{sumTalkdeskTalkTimesecc}} / 60) *.03

Which basically converts seconds to minutes and then * .03 because outbound calls are $.03 per minute. The problem I'm having is inbound calsl are $.02 per minute I wanted to know how I can have the amount multiplied changed from $.02 to $.03 depending on the filter I apply to the table?

-Adam N      

Photo of anwaozo


  • 436 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,320 Points 5k badge 2x thumb

I think I have a way to achieve what you want. You can create another UI-Only formula field (I'll call it amt for now) that will decide the amount to multiply by. Then, you can reference it in your sumTalkdeskTalk formula field, so that it becomes ({{sumTalkdeskTalkTimesecc}} / 60) *{{amt}}. This will allow each row to evaluate which amount to use (.02 or .03).

In your amt formula field, use a formula similar to IF ( {{CallTypeField}} == "Inbound" , 0.02 , IF( {{CallTypeField}} == "Outbound" , 0.03 , not_either_value_here ) ). Make sure to adjust what you're checking the field against based on the values in your data, as it is case sensitive. The other possibly weird part of this approach is that you have to choose a value for call types that aren't inbound or outbound (if those are the only two options then it doesn't matter as much). This formula is working by nesting one IF statement inside another. The normal IF statement syntax is IF( logic_test , value_if_true , value_if_false ). In this case, the value_if_false is another IF statement.

Photo of anwaozo


  • 436 Points 250 badge 2x thumb
This worked thanks!