19 Replies Latest reply: May 13, 2017 4:02 AM by Ruben Marin

# Division Calculation in expression

Hi All,

I want expression to be written in Guage for calculating Profitability with given parameters -

Where

Profit is - P1,P2,P3....Pn

Value is - V1,V2,V3....Vn

Guage should calculate - Profitability -

(P1+P2+P3+....+Pn) / (V1+V2+V3+...+Vn)

div(Sum(Profit),Sum(value)) is not working in expression

Thanks,

Vikas

• ###### Re: Division Calculation in expression

You said P1, P2, P3 ... Pn. But all are string or numbers

• ###### Re: Division Calculation in expression

@Anil,

Its a table where P1, P2 P3 are Profit numbers for Item1, Item2, Item3... Itemn corresponding to Final Value of V1, V2 V3

• ###### Re: Division Calculation in expression

Can you show data please how profit and and value looks?

• ###### Re: Division Calculation in expression
 Item Type value Profit Low Makeable C 1,302.40 78.10 Cubes M 1,178.10 94.20 Cubes M 2,077.50 145.40 Cubes M 3,945.92 315.70 Cubes M 1,952.50 156.20 High Makeable M 509.86 56.10 High Makeable M 3,063.95 76.60 High Makeable M 1,105.56 71.90 Blacks M 1,385.00 13.90 Blacks M 2,552.00 25.50 Blacks M 1,488.36 14.90
• ###### Re: Division Calculation in expression

Seems working

Or

• ###### Re: Division Calculation in expression

Yes I am expecting this calculation

But when i put the below expression in Qlik sense,

Div(Sum(Profit),Sum(value))

the calculated field shows "0"

• ###### Re: Division Calculation in expression

Hi are you expecting like this in Guage chart

• ###### Re: Division Calculation in expression

NO

• ###### Re: Division Calculation in expression

as Per your expression  Guage chart is showing result

is 4 is it correct?

• ###### Re: Division Calculation in expression

Data I have provided should give me 5.1 as result in guage

• ###### Re: Division Calculation in expression

Hi

as per data it was showing  result is 5

• ###### Re: Division Calculation in expression

is it ok

• ###### Re: Division Calculation in expression

Hi please find the attached file

• ###### Re: Division Calculation in expression

Ceil do not give me perfect value

I want