Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
brice_roselier
Contributor II
Contributor II

Count and filter on few columns and max

Hello,

Thanks to some answer on this forum, I succed to filter data on few columns. But now I need to filter on few colums and one of them is the max value. I tried this but this does not reply correct answer.

id, date, status, type, value
1,2019-04-01,Error,'AS,10
2,2019-04-01,Warning,AS,1
3,2019-04-01,Error,AS,1
4,2019-03-31,Error,AS,1
5,2019-03-31,Info,AS,1
6,2019-03-30,Error,AS,1
7,2019-03-30,Info,AS,1
8,2019-03-30,NA,AS,1
9,2019-03-30,NA,AS,1

I need to count how many rows when date is max, status is error, type is AS
Count({<date={$(=max(date))}, status={"Error"}, type={"AS}>}status)

Count({<date={$(max(date))}, status={"Error"}, type={"AS}>}status)

1 Solution

Accepted Solutions
danilostochi
Creator II
Creator II

Hi, this will answer you.

=Count({<date={"$(=date(Max(date),'YYYY-MM-DD'))"}, status={'Error'}, type={'AS'}>}status)

 

+55(44) 9 9993-3605, WhatsApp
E-Mail or Skype - danilo16stochi@hotmail.com

View solution in original post

6 Replies
felipessj
Contributor III
Contributor III

Hello, try using
Count(distinct {<date={$(=max(date))}, status={"Error"}, type={"AS"}>}id)
danilostochi
Creator II
Creator II

Hi, this will answer you.

=Count({<date={"$(=date(Max(date),'YYYY-MM-DD'))"}, status={'Error'}, type={'AS'}>}status)

 

+55(44) 9 9993-3605, WhatsApp
E-Mail or Skype - danilo16stochi@hotmail.com
brice_roselier
Contributor II
Contributor II
Author

Thank you, but this returns 0

brice_roselier
Contributor II
Contributor II
Author

Thank you @danilostochi this resolve my problem

felipessj
Contributor III
Contributor III

Please, try again and use this
please take care about date formats

=Count(distinct {<date={"$(=date(max(date),'dd-MM-YYYY'))"}, status={"Error"}, type={"AS"}>}id)

If it does not work, change " by ', like this date={"$()"} -> date= {'$()'}
brice_roselier
Contributor II
Contributor II
Author

Yes, this looks like the other answer, and this solves my problem. Thank you very much