Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

load script '+'

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;

3 Replies
sunny_talwar

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;

avinashelite

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 ??

MarcoWedel

IF(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0602999999'  AND CONTO_COSTO<>'0602000000' ,IMPORTO_CONTO_COSTO) AS W_AN_TEST