# Community Corner

Discussion board for questions about the Qlik Community Platform as well as general discussions and even some fun. This is for both new and longtime community members. Everyone is welcome!

cancel
Showing results for
Did you mean:
Contributor III

## Using two aggregate functions

Hi

I want to count cities having sum(Quantity)>1000 and sum(Sales)>1200 for the maximum month year in Date( In sample Data :- Sept. 2018)

Sample Data:

 City Quantity Sales(Rs) Date C1 1000 2000 12-Sep-18 C2 12312 12310 13-Sep-18 C3 121 21223 12-May-18 C4 1212 1313 30-Aug-17 C1 1212 12123 20-Sep-18 C2 121 1313 08-Nov-18 C3 121 132 09-Nov-17
1 Solution

Accepted Solutions
MVP
Try like:

Count(Distinct {<City={"=Sum(Quantity)>1000 and Sum(Sales)>12000"}>}City)
4 Replies
MVP
Try like:

Count(Distinct {<City={"=Sum(Quantity)>1000 and Sum(Sales)>12000"}>}City)
Contributor III
Author
How to find for the max Month Year in the Date field?
MVP
Did you get solution to your base query in my response? If so, please Like/Accept as solution that reply. And for new query you should create a new thread.
To your max month year query: Try: =MonthName(Max(Date))
Contributor III
Author
Thanks, I got answer to base query .
And where to include MonthName(Max(date)) in the expression , I am not able to get correct result.
Community Browser