Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to nest an IF statement within another IF statement? So for example for the below... would that be the best way of doing things?
If(Len(NetSalesValue) > 9, 0, NetSalesValue) as [Invoice Value], if(NetSalesValue < 0, NetSalesValue, 0) as [Credit Value], |
I would like to still apply the Invoice Value IF to the Credit Value.
Hi Lewis,
Yes, that's possible indeed and should work just fine in the script. Check this syntax:
If(
If(Len(NetSalesValue) > 9, 0,NetSalesValue) < 0,
NetSalesValue, 0) as [Credit Value],
Hope that helps.
Miguel
Hi Lewis,
Yes, that's possible indeed and should work just fine in the script. Check this syntax:
If(
If(Len(NetSalesValue) > 9, 0,NetSalesValue) < 0,
NetSalesValue, 0) as [Credit Value],
Hope that helps.
Miguel
I think the problem you have is that you have called the NetSalesValue twice... try the formula below..
if(If(Len(NetSalesValue) > 9, 0, NetSalesValue)< 0, NetSalesValue, 0) as [Credit Value],
Or you could use this.
If(Len(netSalesValue)>9 and NetSalesValue<0, NetSalesValue,0) as [Credit Value],
I Hope this helps
Ali
Thanks again Miguel, thats perfect and works a treat!