Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Together,
I am looking for an IF formula that returns 0 if the result of the following formula is greater than 0, otherwise it should return the result of the formula.
formular:
sum( if(
aggr(sum( {$<[CostType Art] = {'ERLÖS'}, Fahrttyp={'Zustellung'}>} [Betrag netto (BETNTO)]),[SendungsID (SDGID)],[SDG (DATUM)])
>0,
aggr(sum( {$<[CostType Art] = {'ERLÖS'}, Fahrttyp={'Zustellung'}>} [Betrag netto (BETNTO)]),[SendungsID (SDGID)],[SDG (DATUM)])
,
aggr(sum( {$< Fahrttyp={'Zustellung'}>} [SDG ATTR_VORBEWERT]),[SendungsID (SDGID)],[SDG (DATUM)])
)
)
-
Sum( {$<[CostTypeNr (COSTTYPE)] = {'12','13','14'}>} if( [FahrtID Fahrt (FARID)]=[FahrtID AbrechnungsLA (FARID)], [Betrag netto (BETNTO)]))
+
(
Sum( {$<[CostTypeNr (COSTTYPE)] = {'15'}, Fahrttyp={'Zustellung'} >} [Betrag netto (BETNTO)])
+
Sum( {$<[CostTypeNr (COSTTYPE)] = {'16'}, Fahrttyp={'Zustellung'} >} [Betrag netto (BETNTO)])
+
Sum( {$<[CostTypeNr (COSTTYPE)] = {'14'}, Fahrttyp={'Zustellung'}>}
if( [FahrtID Fahrt (FARID)]=[FahrtID AbrechnungsLA (FARID)],[Betrag netto (BETNTO)]))
)
+
(Sum( {$<[CostTypeNr (COSTTYPE)] = {'11','12','13'}, Fahrttyp = {'Zustellung'} >}
if( [FahrtID Fahrt (FARID)]=[FahrtID AbrechnungsLA (FARID)],0,
if(len([FahrtID AbrechnungsLA (FARID)])=0,0,
[Betrag netto (BETNTO)])))
)
thank you for your support & a successful year 2021!
Hi @AlanM,
You can use If( [your formula] >0, 0, [your formula]). It's going to be a long expression. You may add your formula to a variable and use the variable in the expression. This is purely for visual purposes and will not enhance performance.
Hope this helps.
Hi @AlanM,
You can use If( [your formula] >0, 0, [your formula]). It's going to be a long expression. You may add your formula to a variable and use the variable in the expression. This is purely for visual purposes and will not enhance performance.
Hope this helps.
Hi Primrose,
thanks for the fast answer. I was struggling with a bracket problem, but is now taken care of.
Good idea with the variables, thank you very much..