Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
rviel_dubo
Contributor III
Contributor III

Why does MIN value from an AGGR expression return a 0 when no value are equal to zero

Hi everyone,

I've got an aggr function that should return the maximum and minimum number of order managed per month for the last 24 months.

The max works fine (19510) but the minimum returns 0, see example below.

min_aggr.png

I'm getting gray hair over this so please any suggestions will help! 🙂

Thanks,

Robert V.

1 Solution

Accepted Solutions
sunny_talwar

How about this?

 

Min({<Sales_MonthSEQ = {">-25<0"}>}
  Aggr(
    Count({<Sales_MonthSEQ = {">-25<0"}>} DISTINCT OrderNo)
  , Sales_MonthName)
)

 

 

View solution in original post

12 Replies
lironbaram
Partner
Partner

hi

first thing to check is that in your table properties 

under presentation tab you uncheck the option suppress zero values 

usually i'll assume you have some values that are assigned to null month , so you don't see it in the table 

rviel_dubo
Contributor III
Contributor III
Author

Hi Lironbaram,

 

That's the first thing I've looked and that's why I've place a picture of my table along with my request, option is already unchecked and I've got 24 results (24 months rolling). that's why I've having gray hair over this.

Thanks anyway 🙂

sunny_talwar

How about this?

 

Min({<Sales_MonthSEQ = {">-25<0"}>}
  Aggr(
    Count({<Sales_MonthSEQ = {">-25<0"}>} DISTINCT OrderNo)
  , Sales_MonthName)
)

 

 

View solution in original post

rviel_dubo
Contributor III
Contributor III
Author

No results, 😞

sunny_talwar

Not even showing a 0? Any error messages? Can you show an image of the expression in the expression editor?

rviel_dubo
Contributor III
Contributor III
Author

min_aggr.png

sunny_talwar

This looks like the original expression you had which was showing 0

image.png

Did you try my suggestion?

Min({<Sales_MonthSEQ = {">-25<0"}>}
  Aggr(
    Count({<Sales_MonthSEQ = {">-25<0"}>} DISTINCT OrderNo)
  , Sales_MonthName)
)

Please note that I had a typo on Sales_MonthName field... I have fixed it now... I initially used Sales_Monthname... with a lower case n

rviel_dubo
Contributor III
Contributor III
Author

I've just corrected your typo and it works !!!!
Thanks I really appreciate 🙂
rviel_dubo
Contributor III
Contributor III
Author

Now if I may ask WHY do I need the extra set analysis before the aggr for the min function and not for the max?