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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to change expression to get MAX ID PLEASE HELP!

Hi,

I Have a expression as below in straight table.

Count(Distinct(ID)) & '    '& NUM(Count(Distinct(ID))/COUNT(TOTAL DISTINCT ID),'#,##0.00%')

Could anyone let me know how can I change the expression to get MAX ID.  I used below one

Count(Distinct MAX(ID)) & '    '& NUM(Count(Distinct MAX (ID))/COUNT(TOTAL DISTINCT MAX (ID),'#,##0.00%')

But this is showing 'Error in Expression'.

Thanks.

29 Replies
Not applicable
Author

Thanks and when I sued this it is showing 'Error in Expression'

MK_QSL
MVP
MVP

Remove Persons from all Aggr from above and try it.

Not applicable
Author

Thanks and now it is showing Expression Ok but there is red line showing under

'#,##0.00%')

Not applicable
Author

Thanks and I used variable but no use

MK_QSL
MVP
MVP

Dont worry about RED Lines.. It's only for Syntax Check.

As far as you got your result, it's ok.

Please close the thread by selecting CORRECT answer

Not applicable
Author

Thanks and no I haven't get the expected result. It is showing entirely incotrrect values . Please help me how to set this.

MK_QSL
MVP
MVP

can you upload your sample file?

Not applicable
Author


Please find attached. I should have show the result as in qvw but when i am reloading from database it is showing incorrect values.

MK_QSL
MVP
MVP

Count (DISTINCT [Max  PID]) & ' - '&

NUM(

COUNT(DISTINCT [Max  PID])

/

COUNT(TOTAL DISTINCT [Max  PID])

,'##,#0.00%')

MK_QSL
MVP
MVP

Mandeep has suggested looks right ...

=Count({<ID={"=Max(ID)"}>}Distinct ID)&' - '& Num(Count({<ID={"=Max(ID)"}>}Distinct ID)/Count({<ID={"=Max(ID)"}>}TOTAL ID),'#,##0.00%')