# New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Contributor

## Dividing Figures on Script Loads and Multiply

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 Tags (4)
1 Solution

Accepted Solutions Employee

## Re: Dividing Figures on Script Loads and Multiply

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.

"estrc-cost"/"estrc-weight-qty" as unit

;

SQL SELECT ... FROM ... ;

HIC

3 Replies MVP

## Re: Dividing Figures on Script Loads and Multiply

Do you have a sample which can show this issue? MVP & Luminary

## Re: Dividing Figures on Script Loads and Multiply

As far as I know that's only possible if t1."estrc-cost is 0 or t1."estrc-weight-qty" is 1.

talk is cheap, supply exceeds demand Employee

## Re: Dividing Figures on Script Loads and Multiply

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.