Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ambasadorknz
Contributor II
Contributor II

IF FIELD_A=MAX(FIELD_A) THEN COUNT

Hi All,

I have a table in QlikView like ID, LAST_PAGE, RO_NO(chronological fill order) AND ERROR_NAME.

First question:

When i get max value from RO_NO in calculated dimension i have for each one rows value=3 and it`s true.

but when i use aggregate max function in expressions i get value only for one row(first not null row). WHY??

Second:

I need show on bar chart count ERROR_NAME only when RO_NO=max(RO_NO).

In this example it should be ERROR3=1.

Case should works for more data, aggregated by ID and LAST_PAGE.

I incolse .qvw file

Can anyone help me??

12 Replies
Anil_Babu_Samineni

May be use this Expression

Count({<RO_NO = {'$(=Max(RO_NO))'}>}ERROR_NAME)

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
lironbaram
Partner - Master III
Partner - Master III

hi

have a look at the attachment and changes i made to the chart and table

ambasadorknz
Contributor II
Contributor II
Author

Thanx Guys

works perfectly:)

ambasadorknz
Contributor II
Contributor II
Author

it wasnt work perfectly:(

When i add new ID with other value for RO_NO it stop works:(

expressions show max value for total RO_NO, but should keep max value for agregate group like field in calculated dimension.

Can anyone help one again??

Anil_Babu_Samineni

I've added one value

Capture.PNG

And output is this

Capture1.PNG

Note: Here, Max value is 4 and then we are getting that Max value of ERROR_NAME. In that, what was you are looking for

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ambasadorknz
Contributor II
Contributor II
Author

BUT WITH LOADED DATA I EXCEPT:

ERROR3=2

ERROR5=1

ERROR6=1

(BECAUSE FOR ID:1909 ERROR_NAME FOR MAX RO_NO IS ERROR3

FOR ID: 2020 ERROR NAME FOR MAX RO_NO IS ERROR5

ID: 1000 ERROR_NAME FOR MAX RO_NO IS ERROR6

AND FOR ID: 1010 ERROR_NAME FOR MAX RO_NO IS ERROR3)

Anil_Babu_Samineni

May be try this? And sorry, I forget to see the attachment earlier

Aggr(If(RO_NO=Max(TOTAL <ID> RO_NO), Count(ERROR_NAME)), ID, RO_NO)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ambasadorknz
Contributor II
Contributor II
Author

its not working...

have you any idea ??

Anonymous
Not applicable

Dual(If(RO_NO=Max(RO_NO), ERROR_NAME, '  '),count(ID))