Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
herbert_beck
Contributor III
Contributor III

min (aggr(sum(revenue), customer)) isn’t working for the grand total

Dear QlikView-Community,

I'm new to Qlikview and I'm trying to get the minimun revenue and the maximum revenue by customer dimension for each customer segment and the grand total.

a) Max (aggr(Sum(revenue), customer)) is working fine

b) Min (aggr(Sum(revenue), customer)) isn’t working in the grand total line of a table chart. It returns 0 although the sum(revenue) of the "smallest" customer is 232 EUR.

Kind regards,

Herbert


P.S.:

I'm currently working with the personal edition.

The data model is: customer segment > customer > order < product

A copy of the problem is:


@ min sum aggr

Nachricht geändert durch Herbert Beck

16 Replies
MK_QSL
MVP
MVP

What are the Name of Dimensions in this table?

if possible, kindly upload your sample file.

herbert_beck
Contributor III
Contributor III
Author

Dear Manish,

thanks for your reply. My application is in German, therefore I translate it for you to English.

the only dimension is customer (in the picture: KundenNr). The revenue corresponds to UmsatzBestZeile.

Kind regards,

Herbert

MK_QSL
MVP
MVP

can you upload your application?

herbert_beck
Contributor III
Contributor III
Author

Dear Manish,

well it's still too big. I will downsize it.

Kind regards,

Herbert

herbert_beck
Contributor III
Contributor III
Author

Hi Manish,

I'm sorry it took a little while. When downstripping the application I found that the problem ist related to the time dimension. Therefore a come up with new numbers but the problem remains the same:

The data model is:

agilos_mla
Partner - Creator III
Partner - Creator III

Hi Herbert,

Due to the way you built the calendar table, you populate dates for wich there are not order then when using the aggr function, QV creates a row with sum(revenue)=0 for all the dates where there is no revenue (missing values)

You should use :

Min (aggr(Sum({<revenue={"<>0"}>}revenue), customer_id))

Michael.

Anonymous
Not applicable

Try changing the expression total to Min like in the picture below.

Image 1.png

herbert_beck
Contributor III
Contributor III
Author

Hi Micheal,

thank for your reply. i tried it, but there is no change in the grand total line. An the amazing fact is that it works with  the expression Total in max column. I assume that there might be a problem with other dimensions.

Kind regards,

Herbert

agilos_mla
Partner - Creator III
Partner - Creator III

Hi Herbert,

Due to the way you built the calendar table, you populate dates for wich there are not order then when using the aggr function, QV creates a row with sum(revenue)=0 for all the dates where there is no revenue (missing values)

You should use :

Min (aggr(Sum({<revenue={">0"}>}revenue), customer_id))

Michael.