Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rank Filter and Selection Filter in Set Expression

I am working with incident data in the following format where each row details one registered incident:

IDPriorityComponent
1SevereTill
2ModerateSoftware
...CriticalHardware

I attach some sample data.

I have a list box/field that allows for the user to select the 'Priority' level. I am trying to create a KPI that does the following: Counts the number of incidences - i.e. Count(ID) - only for the priority level selected (or all if none selected) and only for the top 5 components by Count(ID).

I have attempted the following with no joy:

Count({1<[Priority] = P([Priority])>*1<[Component] = {"=Rank(Count([ID]))<=5"}>} [ID])

Any help would be greatly appreciated.

Kind regards,

1 Solution

Accepted Solutions
sunny_talwar

How about this

=Count({1<Ccomponent = {"=Num(Rank(Count({1<Priority = $::Priority>}ID), 3, 1)) <= 5"}, Priority = $::Priority>} ID)

View solution in original post

12 Replies
sunny_talwar

May be this:

Count({1<Ccomponent = {"=Num(Rank(Count(ID), 4, 1)) <= 5"}>} ID)

Not applicable
Author

This doesn't seem to be what I'm looking for. I'm also not sure what Num does in this context.

To be clear what I want is a count of the ID's for the top 5 components that will only vary if a selection is made on the Priority level. If any other selection is made I want nothing to change.

sunny_talwar

Would you be able to elaborate as to what you are trying to get

Not applicable
Author

"what I want is a count of the ID's for the top 5 components that will only vary if a selection is made on the Priority level. If any other selection is made I want nothing to change." This what I am trying to get.

I would like the result to filter down if a selection is made in the Priority field but not if a selection is made in the component field. And I would like the result to always show the count from the top 5 components within the selected Priority level.

sunny_talwar

I think it would be better if you can point out the expected number based on selection in different Priority level selection. If I have the numbers you are trying to get, I might be able to help you better

Not applicable
Author

No Priority selection: 280

Priority 1: 42

Priority 3: 190

Priority 2 + Priority 3: 236

And if any component or set of components is selected these numbers should not change

sunny_talwar

Check out this expression:

=Count({1<Ccomponent = {"=Num(Rank(Count(ID), 3, 1)) <= 5"}, Priority = p(Priority)>} ID)

Not applicable
Author

Hi Sunny,

Unfortunately this doesn't seem to work for me.

If I make a selection on one of the components it updates the total. I do not want this to happen. I just want the total to update if Priority is changed. See below. The total should not change for the bottom KPI.

qlikexample.png

sunny_talwar

How about this?

=Count({1<Ccomponent = {"=Num(Rank(Count({1<Priority = p(Priority)>}ID), 3, 1)) <= 5"}, Priority = p(Priority)>} ID)