Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Charlie007
Contributor III
Contributor III

Ranking Issue

=Num(COUNT(DISTINCT{<CONTRACT_NUMBER= {"=Rank(COUNT(DISTINCT PO.PROC_AGENCY={'Supply Logistics APS'}),4) and Rank(COUNT(DISTINCT CONTRACT_NUMBER),4)<=vTopN"}>}PO.PROC_AGENCY),'#,##0')

I am getting result zero by running this formula in expression of Text Box.

I actually want to count Proc_Agency (dimension) on the basis of Contract_Number in the table but at the same time I want to count this on the basis of variable vTopN whose value can be 5, 10 or all records in the table. I have done it by using Proc. Agency (dimension) but unable to find its value when variable vTopN is used as shown above.

Without the use of vTopN variable my formula is looked like

=Count(DISTINCT{<PO.PROC_AGENCY={'Supply Logistics APS'}>} CONTRACT_NUMBER)

Please guide me to resolve this issue.

1 Reply
Brett_Bleess
Former Employee
Former Employee

Charlie, I suspect the reason for no responses is lack of a sample QVW with the issue, as these are a bit difficult to troubleshoot without that, as folks need to see the data model, chart and expressions etc. in order to try to figure out what may be wrong.  If you are concerned about sensitive data, you can use the Settings\Document Properties\Scrambling tab in the Desktop client to scramble any sensitive fields...

I did find a Design Blog post on Rank though, might be helpful to you too:

https://community.qlik.com/t5/Qlik-Design-Blog/Rank-Function/ba-p/1466430

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.