Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

vikas_nandanwar
Contributor II

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


Please guide


Thanks,

Vikas

1 Solution

Accepted Solutions
vikas_nandanwar
Contributor II

Re: Division Calculation in expression

I got it

Sum(Profit)/Sum(Value) gave me the desired answer.

Thanks for the help.

19 Replies

Re: Division Calculation in expression

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

Life is so rich, and we need to respect to the life !!!
vikas_nandanwar
Contributor II

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?

Life is so rich, and we need to respect to the life !!!
vikas_nandanwar
Contributor II

Re: Division Calculation in expression

ItemTypevalueProfit
Low MakeableC1,302.4078.10
CubesM1,178.1094.20
CubesM2,077.50145.40
CubesM3,945.92315.70
CubesM1,952.50156.20
High MakeableM509.8656.10
High MakeableM3,063.9576.60
High MakeableM1,105.5671.90
BlacksM1,385.0013.90
BlacksM2,552.0025.50
BlacksM1,488.36

14.90

Re: Division Calculation in expression

Seems working

Capture.PNG

Or

Capture.PNG

Life is so rich, and we need to respect to the life !!!
qlikview979
Valued Contributor

Re: Division Calculation in expression

Hi are you expecting like this in Guage chart

Untitled.png

vikas_nandanwar
Contributor II

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"

vikas_nandanwar
Contributor II

Re: Division Calculation in expression

NO

Highlighted

Re: Division Calculation in expression

Seems, Qliksense also working

Capture.PNG

Life is so rich, and we need to respect to the life !!!