Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possibile to sum in load script as listed below (in red)?
Thank you
LOAD
CONTO_COSTO,
CAUSALE_CONTOCOSTO,
IMPORTO_CONTO_COSTO,
IF(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0601999999', IMPORTO_CONTO_COSTO) AS W_AN_PROD,
IF(CONTO_COSTO>='0602000001' AND CONTO_COSTO<='0602999999', IMPORTO_CONTO_COSTO) AS W_AN_LAVORAZIONE,
((IF(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0601999999', IMPORTO_CONTO_COSTO))+(IF(CONTO_COSTO>='0602000001' AND CONTO_COSTO<='0602999999',IMPORTO_CONTO_COSTO))) AS W_AN_TEST;
Not sure what the intent is because CONTO_COSTO will either fall in the first if or second if and the other will be just 0. If this is what you want, you can try this:
RangeSum(
If(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0601999999', IMPORTO_CONTO_COSTO), If(CONTO_COSTO>='0602000001' AND CONTO_COSTO<='0602999999',IMPORTO_CONTO_COSTO)) AS W_AN_TEST;
If IMPORTO_CONTO_COSTO is a number filed its possible but as per your condition
the CONTO_COSTO will fall in any of the 1 interval so the other part will be always zero..
((IF(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0601999999', IMPORTO_CONTO_COSTO))
OR
for the primary key you have the dates for both the interval ??
IF(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0602999999' AND CONTO_COSTO<>'0602000000' ,IMPORTO_CONTO_COSTO) AS W_AN_TEST