Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

agaetisproject
New Contributor III

Forecast sales values computation using average sales price (set analysis)

Hi all,

I am trying to compute a sales amount forecast based on the number of units forecast and the average sales price of a unit.

I struggle with a set analysis statement that is intended to calculate the average sales price of each unit and for each country.

Below is my table:

2015-09-11_1349.png

Th expression for the average price is (intended to get the average price per unit, regardless of the year).

avg({$<Year = {*}>} Value/Unit sold)

My issue is that the yellow cells stick to 0 in my table whereas I would like see in there the average price based on years where there was sales.

Can anyone help me get this statement correct?

Thanks!

Tags (1)
3 Replies

Re: Forecast sales values computation using average sales price (set analysis)

Last Country is A? How you get 30 Average Price for it?

agaetisproject
New Contributor III

Re: Forecast sales values computation using average sales price (set analysis)

nope Manish, last country is B, sorry for the typo.

Re: Forecast sales values computation using average sales price (set analysis)

You can get average price as below

SUM(TOTAL <Country> Value)/SUM(TOTAL <Country> [Unit sold])

now multiply it with your Forecast Units to get the Forecast Value

Community Browser