Adding to a IFS expression

I have this expression.

IFS(([Qty 1] < [Location].[Container Interval 1]), [Location].[Price 1], [Qty 1] >= [Location].[Container Interval 1b], [Location].[Price Interval 1b], [Qty 1] >= [Location].[Container Interval 1], [Location].[Price Interval 1])

Question: How would I add to this expression that if the value of the [Price Structure] column in the Location table is โ€œFlat Rateโ€ the result would equal blank/ empty.

For context the IFS expression calculates a tier price per container at different container quantity thresholds. However if the overall price plan is โ€œFlat Rateโ€ (instead of "per container) there is no need for the price calculation so the result just needs to be blank or empty.

Thank you in advance for any direction you can provide.

Solved Solved
0 5 537
1 ACCEPTED SOLUTION

Yes Sir. That did it. I was wrong about the Rate Structure. It did need to be โ€œFlat Rateโ€ to accomplish the goal. So the final expression that worked is:

IFS([Location].[Rate Structure] = โ€œFlat Rateโ€,"",[Qty 1] < [Location].[Container Interval 1], [Location].[Price 1], [Qty 1] >= [Location].[Container Interval 1b], [Location].[Price Interval 1b], [Qty 1] >= [Location].[Container Interval 1], [Location].[Price Interval 1])

Thank you @Aleksi for your help. Possibilities with Appsheet are exciting. Enjoy learning more as I go.

View solution in original post

5 REPLIES 5

Add [Price Structure]=โ€œFlat Rate,"", to the beginning after IFS(. If the value needs to be number, use NUMBER(TEXT(""))

@Aleksi

Clarification
[Rate Structure] is in the Location table so I de-referenced in the expression. I want it to produce the math expression result if the Rate Structure in the Location table is โ€œper containerโ€. Empty if โ€œflat rateโ€ so I used โ€œper containerโ€. Is that right?

So as I understand your reply, I tried this:

IFS(([Location].[Rate Structure] = โ€œPer Containerโ€,"", [Qty 1] < [Location].[Container Interval 1]), [Location].[Price 1], [Qty 1] >= [Location].[Container Interval 1b], [Location].[Price Interval 1b], [Qty 1] >= [Location].[Container Interval 1], [Location].[Price Interval 1])

Got this from expression builder:

Arithmetic expression โ€˜(([Location].[Rate Structure] = โ€œPer Containerโ€) < [Location].[Container Interval 1])โ€™ does not have valid input types

Thoughts? And Thank You.

One pair of () too much. Tryโ€ฆ
IFS([Location].[Rate Structure] = โ€œPer Containerโ€,"",[Qty 1] < [Location].[Container Interval 1], [Location].[Price 1], [Qty 1] >= [Location].[Container Interval 1b], [Location].[Price Interval 1b], [Qty 1] >= [Location].[Container Interval 1], [Location].[Price Interval 1])

Yes Sir. That did it. I was wrong about the Rate Structure. It did need to be โ€œFlat Rateโ€ to accomplish the goal. So the final expression that worked is:

IFS([Location].[Rate Structure] = โ€œFlat Rateโ€,"",[Qty 1] < [Location].[Container Interval 1], [Location].[Price 1], [Qty 1] >= [Location].[Container Interval 1b], [Location].[Price Interval 1b], [Qty 1] >= [Location].[Container Interval 1], [Location].[Price Interval 1])

Thank you @Aleksi for your help. Possibilities with Appsheet are exciting. Enjoy learning more as I go.

Youโ€™re welcome

Top Labels in this Space