Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
=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.
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