Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

aggregation on a chart

Hi

I have a problem with the aggr funtion.

aggr(avg(DateArrive-DateOrder),SupplierName)

The problem is that the chart with dimention Article shows only one Article for each supplier.

I would like that the chart contain all the aricles of each supplier

What's wrong in the chart.

Thanks

Andrea

1 Solution

Accepted Solutions
Highlighted
Specialist III
Specialist III

did you try with avg(total <Supplier> (DateArrive-DateOrder)) or

avg(total <Supplier,Article> (DateArrive-DateOrder))

View solution in original post

10 Replies
Highlighted
Partner
Partner

not sure without a sample app, but try nodistinct in the aggr function

Highlighted
Partner
Partner

Advanced Aggregation

There is a special function for advanced aggregations:

aggr ([ distinct | nodistinct ] [{set_expression}]expression {, dimension})

Returns a set of values of expression calculated over dimensions. The result can be compared to the expression column of a 'local chart', evaluated in the context where the aggr function resides. Each dimension must be a single field. It cannot be an expression (calculated dimension).

If the expression argument is preceded by the nodistinct qualifier, each combination of dimension values may generate more than one return value, depending on underlying data structure. If the expression argument is preceded by the distinct qualifier or if no qualifier is used at all, each combination of dimension values will generate only one return value.

By default, the aggregation function will aggregate over the set of possible records defined by the selection. An alternative set of records can be defined by a Set Analysis expression.

By using this function in Add calculated dimension... it is possible to achieve nested chart aggregation in multiple levels. See also Nested Aggregations and Related Issues.

When used in chart expressions it is possible to achieve Sum of Rows in Pivot Tables.

Examples:

aggr( sum(Sales), Country ) 

aggr( nodistinct sum(Sales), Country ) 

aggr( sum(Sales), Country, Region )

count( aggr( sum(Sales), Country ))   

Highlighted
Contributor III
Contributor III

Thank you Ioannis

Unfortunately it does not work. Nodistinct keeps all  the values the same for all products/articles of every suppliers.

Andrea

Highlighted
Not applicable

Hi, Can you provide a your App, so i can take  a look.

Highlighted
Contributor II
Contributor II

Hi

What type of chart you are trying to do?

Highlighted
Contributor III
Contributor III

I attach the qvw

Highlighted
Contributor III
Contributor III

A straight table chart.

Highlighted
Specialist III
Specialist III

did you try with avg(total <Supplier> (DateArrive-DateOrder)) or

avg(total <Supplier,Article> (DateArrive-DateOrder))

View solution in original post

Highlighted
Not applicable

Hi Andrea,

can you change your expression from aggr(avg(DateArrive-DateOrder),SupplierName)

to

aggr(avg(DateArrive-DateOrder),Supplier,Article).

You are missing the Article in your Dimension. Alternatively Ramon Covarrubias solutions also works.

Regs

Ram