Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

mikegrattan
Contributor II

Avg Aggr only returning first number of data set

I am using the following expression in an attempt to return the average number of orders processed per day, for the last seven days, for the specified warehouses.

Avg(Aggr(Count(DISTINCT {1<IsInLast7Days = {1},Warehouse = {'YSS','SSS'}>} SalesOrder),Date))

The actual data set from the chart looks like this:

03.20.2017-10.35.png

The chart data looks fine, and uses the following function:

Count(DISTINCT {1<IsInLast7Days = {1},Warehouse = {'YBF','SBF'},Date>} SalesOrder)

However, the reference line only picks up the first number instead of the average.

Any suggestions would be appreciated.

1 Solution

Accepted Solutions

Re: Avg Aggr only returning first number of data set

Try this:

Avg(TOTAL {1<IsInLast7Days = {1},Warehouse = {'YSS','SSS'}>} Aggr(Count(DISTINCT {1<IsInLast7Days = {1},Warehouse = {'YSS','SSS'}>} SalesOrder),Date))

2 Replies

Re: Avg Aggr only returning first number of data set

Try this:

Avg(TOTAL {1<IsInLast7Days = {1},Warehouse = {'YSS','SSS'}>} Aggr(Count(DISTINCT {1<IsInLast7Days = {1},Warehouse = {'YSS','SSS'}>} SalesOrder),Date))

mikegrattan
Contributor II

Re: Avg Aggr only returning first number of data set

Perfect.  Thanks for the quick answer.

Community Browser