# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Contributor III

## How to sum the avg of all (4) steps only ?

HELLO , i have ORDERS , each can have maximum 4 steps , step have from and to dates , and a close step can be only a step with one step  a head ( if i have steps 1 2 3 then 1 2 are close and 3 is open ) , if there are 4 steps then all are close :

i have a pivot table that shows for each city (hebrew) the avg (months) time for each step :

avg step 1

= sum ( aggr (  avg  (  Interval(    if ( is_step_Close = 1 and step = 1 , to_step_date - from_step_date  )    ,'d') / 30  ) , city  ,step ) )

i need to sum all steps avg BUT only for the orders with all 4 steps , how can i do that ?

THANKS.

- Sorry I did not mention the following detail : all expresions ment only to CLOSE STEPS.

here attached example of the data .

Tags (4)
1 Solution

Accepted Solutions
Highlighted
Honored Contributor

## Re: How to sum the avg of all (4) steps only ?

Hi Yaniv,

As Sunny suggests it would be easier to help you if you can supply a sample. Sometimes that's not so easy. If not then a suggestion for you is to use this expression in set analysis:

{\$<Orders = P({<STEP = {4}>})>}

This will restrict the orders included in an aggregation to those that have attained STEP = 4.

the effect is a  bit like selecting 4 in a listbox for STEP, then in a listbox for Orders selecting all possible then deselecting STEP.

Good luck

Andrew

4 Replies
Highlighted
MVP

## Re: How to sum the avg of all (4) steps only ?

Would you be able to share a sample to test this out?

Highlighted
Honored Contributor

## Re: How to sum the avg of all (4) steps only ?

Hi Yaniv,

As Sunny suggests it would be easier to help you if you can supply a sample. Sometimes that's not so easy. If not then a suggestion for you is to use this expression in set analysis:

{\$<Orders = P({<STEP = {4}>})>}

This will restrict the orders included in an aggregation to those that have attained STEP = 4.

the effect is a  bit like selecting 4 in a listbox for STEP, then in a listbox for Orders selecting all possible then deselecting STEP.

Good luck

Andrew

Highlighted
Contributor III

## Re: How to sum the avg of all (4) steps only ?

hi Sunny ,  i attached a sample , thanks.

Highlighted
Contributor III

## Re: How to sum the avg of all (4) steps only ?

Hi Andrew  - looks OK - great help - THANKS !!