Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
harveenkaur
Contributor III
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
tresesco
MVP
MVP

Try like:

Count(Distinct {<City={"=Sum(Quantity)>1000 and Sum(Sales)>12000"}>}City)

View solution in original post

4 Replies
tresesco
MVP
MVP

Try like:

Count(Distinct {<City={"=Sum(Quantity)>1000 and Sum(Sales)>12000"}>}City)
harveenkaur
Contributor III
Contributor III
Author

How to find for the max Month Year in the Date field?
tresesco
MVP
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))
harveenkaur
Contributor III
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.