Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Display top N most frequent records in chart

Hi all - I'm trying to do something that I assume is a simple calculation that I'm struggling with for some time now.

Goal: display only the records that appear more than 2 times in a dataset.

Example of data:

TableIDICD-9 CodePatient IDVisit ID
12501A
22502B
32503C
4194D
54935E
64936F
71505G
94938H
104938I

I'd like to produce a list of all ICD-9 codes that appear more than 2 (or any #) of times in the data, including both the ICD-9 Code value and the count of how many times this unique code appeared

Example output

ICD-9 Code# of times the code was found in data (must be at least 2 times)
2503
4934

I've tried a few versions of this but can't seem to get it right

count( DISTINCT {<DX ={"=count(DX)>100"}>}DX), DX

If(Rank(Count(DISTINCT DX)) >100, Count(DISTINCT DX))

Thanks in advance!

4 Replies
Highlighted

Try this

Dimension

ICD-9 Code

Expression

Count({<[ICD-9 Code] = {"=Count(DX) >= 2"}>}DX)

Highlighted
MVP
MVP

Create a Straight/Pivot Table


Dimension

[ICD-9 Code]

Expression

Count(Distinct{<[ICD-9 Code] = {"=COUNT(Distinct TableID) > 2"}>}TableID)

Or

Count({<[ICD-9 Code] = {"=COUNT([ICD-9 Code]) > 2"}>}[ICD-9 Code])

Highlighted

Here is a sample attached

Capture.PNG

Highlighted
Partner
Partner

Thanks so much - I knew it had to be something simple!