Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a price for a product which I want to compare with another price (e.g. band1_price from a set of price bandings) with a tolerance, say of 1%. Instead of an exact match with = it needs to be within 1% either side. The equivalent of:
if(band1_price * 9.99 < product_price < band1_price * 1.01,'As Band 1','Probably more ifs here for more than and less than')
Can anyone tell me what the syntax is please?
Thanks, Jackie
May be something like this:
If((band1_price * 0.0099) < product_price and (band1_price * .0101) > product_price, 'Band 1') as BandField
Thanks Sunny. I came to the same conclusion in the end, but was hoping for something a little more concise, like when you can set date ranges with startdate < datefield < enddate. As I'm comparing with a number of bands its a nested if, so will be quite long-winded.
Depending on your band, you might only need upper conditions because the if statement is executed in the order of condition. If the first condition is met, it won't give you a result past that. (Note: First condition might still need two checks)