Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

dmac1971
Contributor II

Expression Problem

OK hitting a brick wall on this one.  I have a piece of work that lets us estimate useage levels against population.  3 sliders are used to input where we expect figures to be and everything is working fine bar on a google map that I have.

Calc is as follows :

(sum({<Year = {'2016'}>} Units))

/

Round  (((sum({$<Type = {'Red'}>}Part_Qty)*$(vRedChanges))*2)*$(vPoint_In_Year))

+          (((sum({$<Type = {'Blue'}>Part_Qty)*$(vBlueChanges))*2)*$(vPoint_In_Year))

+          (((sum({$<Type = {'Green'}>}Part_Qty)*$(vGreenChanges))*2)*$(vPoint_In_Year))

So this is # units sold / expected # units, to get a % result of how sales are doing.

If I check each part of the calc everything is fine, ie the sum of units is correct, and the sum of Part Qty is fine however when entered as above I get the wrong answer, so I'm missing something.

Same calc is used in numerous locations in my report but in charts etc and works fine, its only failing on the google map, and is only used here as pop up when you mouse over an account etc.

1 Solution

Accepted Solutions
manucamon
Valued Contributor III

Re: Expression Problem

Hi Dermot,

Try with a rangesum:

(sum({<Year = {'2016'}>} Units))

/

Round  (

     RangeSum(

     sum({$<Type = {'Red'}>}Part_Qty)*$(vRedChanges)*2*$(vPoint_In_Year),

     sum({$<Type = {'Blue'}>Part_Qty)*$(vBlueChanges)*2*$(vPoint_In_Year),

     sum({$<Type = {'Green'}>}Part_Qty)*$(vGreenChanges)*2*$(vPoint_In_Year)

     )

)

Regards!!

2 Replies
manucamon
Valued Contributor III

Re: Expression Problem

Hi Dermot,

Try with a rangesum:

(sum({<Year = {'2016'}>} Units))

/

Round  (

     RangeSum(

     sum({$<Type = {'Red'}>}Part_Qty)*$(vRedChanges)*2*$(vPoint_In_Year),

     sum({$<Type = {'Blue'}>Part_Qty)*$(vBlueChanges)*2*$(vPoint_In_Year),

     sum({$<Type = {'Green'}>}Part_Qty)*$(vGreenChanges)*2*$(vPoint_In_Year)

     )

)

Regards!!

dmac1971
Contributor II

Re: Expression Problem

Manuel that was the answer, perfect!!! Many thanks will read up on this function.

Community Browser