Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have recently been doing working on calculations on load script the following works :
((( (((t0."estp-blank-l"*t0."estp-blank-w")/1000000)*t1."estrc-coverage")*(t3.OrderedQty+2500))*t1."estrc-usage")/100000) as "Calculated Ink Kg"
However a simple divide by as below doesn't?
((t1."estrc-cost")/(t1."estrc-weight-qty")) as unit,
But same statement will multiply?
((t1."estrc-cost")*(t1."estrc-weight-qty")) as unit,
Thanks Brett
In your other question (Table Links and Sums in Scripts, Create new field.) you have this expression inside a SQL SELECT. Maybe this is the problem? Any calculation inside a SELECT statement is executed by the ODBC driver and not by QlikView, and there could be limitations e.g. integers that cannot be divided to form new non-integer numbers.
Try a Preceding Load instead:
Load *,
"estrc-cost"/"estrc-weight-qty" as unit
;
SQL SELECT ... FROM ... ;
HIC
Do you have a sample which can show this issue?
As far as I know that's only possible if t1."estrc-cost is 0 or t1."estrc-weight-qty" is 1.
In your other question (Table Links and Sums in Scripts, Create new field.) you have this expression inside a SQL SELECT. Maybe this is the problem? Any calculation inside a SELECT statement is executed by the ODBC driver and not by QlikView, and there could be limitations e.g. integers that cannot be divided to form new non-integer numbers.
Try a Preceding Load instead:
Load *,
"estrc-cost"/"estrc-weight-qty" as unit
;
SQL SELECT ... FROM ... ;
HIC