Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
william_wright
Contributor II
Contributor II

How to create 4 straight table charts that seperate stores into quartiles based on GP%

Can I use the dimension limitation function to create 4 seperate straight table charts ranking stores based on their GP%'s with each straight table containing 16 stores? The first table would include highed 16, next would include 17-32, the next would include 33-48, and the last would include the bottom 16.

10 Replies
zebhashmi
Specialist
Specialist

if you are looking within a table you can use Class() for that

for a different table, you can use set analysis on a dimension

OmarBenSalem

Use the rank() function:

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

Exp of use:

Table1: first 16

dimension: YourDim

Measure: sum({<YourDim={"=rank(sum({<YourDim>}YourMeasure),YourDim)<=16"}>}YourMeasure)


Table2: btwn 17-32

dimension: YourDim

Measure: sum({<YourDim={"=rank(sum({<YourDim>}YourMeasure),YourDim)>=17"}>

*

<YourDim={"=rank(sum({<YourDim>}YourMeasure),YourDim)<=17"}>

}YourMeasure)


Table3: btwn 33-48

dimension: YourDim

Measure: sum({<YourDim={"=rank(sum({<YourDim>}YourMeasure),YourDim)>=33"}>

*

<YourDim={"=rank(sum({<YourDim>}YourMeasure),YourDim)<=48"}>

}YourMeasure)


Table1: >48

dimension: YourDim

Measure: sum({<YourDim={"=rank(sum({<YourDim>}YourDim),YourDim)>48}>}YourMeasure)

william_wright
Contributor II
Contributor II
Author

I used the dimension limitation to calc the top 16 and then tried the following code:

sum({<A277_DEAL_LOCN={"=rank(sum({<A277_DEAL_LOCN>}A277_DEAL_LOCN),A277_DEAL_LOCN)<=16"}>}vNewFSGP%YTD)

The second table didn't return any results.

Could this be because I'm using a variable as a measure?

OmarBenSalem

my bad !!

it's

sum({<A277_DEAL_LOCN={"=rank(sum({<A277_DEAL_LOCN>}vNewFSGP%YTD),A277_DEAL_LOCN)<=16"}>}vNewFSGP%YTD)

william_wright
Contributor II
Contributor II
Author

I've entered the code as specified but I'm not returning any data in my table.

OmarBenSalem

If It does work, please close the thread by marking the correct answer as correct @william.wright

william_wright
Contributor II
Contributor II
Author

It's not returning any data

OmarBenSalem

It's working for me.

Can u post an image of what u've done and maybe the dimension and measures ure using?

william_wright
Contributor II
Contributor II
Author

could it possibly be because I am using a variable I created to calc the GP% (vNewFSGPYTD)?

would this require a different syntax?