Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
andyrebs
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
ramoncova06
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
giakoum
Partner - Master II
Partner - Master II

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

giakoum
Partner - Master II
Partner - Master II

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 ))   

andyrebs
Contributor III
Contributor III
Author

Thank you Ioannis

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

Andrea

Not applicable

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

lucasjsantos
Contributor II
Contributor II

Hi

What type of chart you are trying to do?

andyrebs
Contributor III
Contributor III
Author

I attach the qvw

andyrebs
Contributor III
Contributor III
Author

A straight table chart.

ramoncova06
Specialist III
Specialist III

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

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

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