Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld starts MONDAY! last chance to register is now ! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kizzydavies
Creator
Creator

Cannot get AGGR expression to work

Hi,

I asked a previous question on how to create a bar chart that displays 1 value but is filtered by another.

An expression was given (see below)

=if( RANK( Sum({$<[Requisition Status]={Closed}>}[Number of Filled Reqs]) )<=5,Sum({$<[Division]={'Lifestyle Audio'}>}[Approve to Close])/Sum({$<[Division]={'Lifestyle Audio'}>}[Number of Filled Reqs]))

The expression works but shows the countries that are not are not in the top 5.  I then got this instruction but I cannot get it to work

=AGGR(if(RANK(SUM(Sales))<=4,Country),Country) and then check suppress null values

QLIK Rank screen shot.PNG


Please help.Thanks,Kizzy

23 Replies
YoussefBelloum
Champion
Champion

The Rank function can take 3 parameters

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/ChartFunctions/RankingFu...

which explain the number 4

Also when you have one dimension in your table, no need to specify it in the Rank function.

YoussefBelloum
Champion
Champion

Hi,

here is QVF example, on which you have the desired result.

data rank.png

Take a look on how it works and try to adapt.

JustinDallas
Specialist II
Specialist II

Like Omar said, you still don't have single quotes around Closed in your first line.  I'm not sure how important that is, but that's the syntax I'm accustomed to seeing.

if( RANK(Sum({$<[Requisition Status]={

'

Closed

'

},[Division]

kizzydavies
Creator
Creator
Author

Hi All,

The AGGR worked once I removed the the if(sum..... from the dimension and just used the normal measure.


Thanks,

Kizzy

View solution in original post