Combining Cases in If-Then-Else column

Good day. I have changed the tariff structure for my customers and it now has options for full-time, semi-full time and part-time passengers. Full-time passengers reserve a seat for every trip, semi’s for half of the trip and part-time not at all (like standby). I addition, if a customer has more than 1 child on the bus, the extra kids get a 20% discount each.

I want to calculate the tariff for each child in a column in the Children table but the order of the cases has me stymied. There has to be cases for:

  1. 1st child, full-time or semi-full time (tariff code <50, SibSeq=1,uses FullTariff column value)
  2. Additional child, full-time or semi-full time (tariff code <50, SibSeq>1,uses Discount column value)
  3. Any standby child (tariff code >50, uses FullTariff column value)

I can get the standby tariff and either the 1st child or additonal child correct, but the other child’s tariff is blank. I have read the docs but it really is not worth the screen estate it occupies. I saw a post long ago about combining AND and OR (basically put the negative answers first, or something like that - can’t find it now), but the logic flow still escapes me.

Here is a screenshot:

The trick here is to reverse your logic, and use a process of elimination. Try the following:

  • If Tariff Code > 50, then FullTariff
  • If SibSeq > 1, then Discount
  • If SibSeq = 1, then FullTariff

Question: What should happen if SibSeq is less than 1? (or is that not possible?)

1 Like

Thank you so much Darren ,I will try it soon - not home at the moment.
Since the SibSeq is the actual order in which siblings are added, a negative number is not possible. Should the eldest one finish school, they just get a new Status # which is ignored when calculating SibSeq.

Worked a dream! Thanks @Darren_Murphy .

1 Like