Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sjmghames
Partner - Contributor II
Partner - Contributor II

Set Analysis involving a condition having a variable that changes per dimension

Hi,

I have a set of data , say invoices with 3 columns

Table:

Invoice Key    Hospital Name    Invoice Items Count

1                      A                        2

2                      A                        4

3                      A                        4

4                      B                        3

5                      B                        5

I need to build a table which gives the following:

Visualization:

Hospital Name           Max Invoice Items Count per Invoice            Invoice Count having max invoice items count

A                                 4                                                                      2

B                                 5                                                                      1

Column 2 ( i.e. Max Invoice Items Count per Invoice) formula: Max (Invoice Items Count)

How can I get column 3 (Invoice Count having max invoice items count) formula? I need to know how many invoices have the max invoice items count per hospital.

I tried : count({<[Invoice Items Count] = {"$(=Max([Invoice Items Count]))"}>} Invoice Key) but it didnt work.


Any help??

2 Replies
sjmghames
Partner - Contributor II
Partner - Contributor II
Author

Can anyone help in this?

sunny_talwar

May be this

Dimension

Hospital Name

Expression

Max([Invoice Items Count])

Count(Aggr(If([Invoice Items Count] = Max(TOTAL <[Hospital Name]> [Invoice Items Count]), [Invoice Items Count]), [Hospital Name], [Invoice Items Count]))