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: 
qlikuser222
Creator
Creator

Dynamic Count?

Hi Everyone,

 

I have a requirement here i have to show top 2 and bottom  5 dimensions in two separate tables but i also need to show the count of those dimensions in variables (should be dynamic).

 

Can anyone please help me to achieve this ?

 

PFA for example.

 

Thanks

Labels (4)
1 Solution

Accepted Solutions
Gysbert_Wassenaar

Perhaps this: =rangemin(2, count(distinct MyDimension))


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
Gysbert_Wassenaar

I'm afraid I don't understand. The top 2 is always 2 items. Why do you need a variable for that?

Or do you want to choose dynamically how many items should be shown in a Top X? In that use the variable for both purposes, to set the limit on the Dimension Limits tab and to show the limit value in the text object. Same for the Bottom Y.

You could use slider objects to allow the user to change the values of the variables.

You can find an example here: https://community.qlik.com/t5/Qlik-Sense-Enterprise-Documents/Slider-to-Display-Top-n-Entities/ta-p/...


talk is cheap, supply exceeds demand
qlikuser222
Creator
Creator
Author

Thanks for the reply,

 

I want to create a text box with a variable showing top 2 and other one with bottom 5 and they should be dynamic.

 

Thanks

Gysbert_Wassenaar

Let's try that again. Please answer yes or no only to the following questions:
Should the text box show the number 2 when the table shows the Top 2?
Should the text box show the number 5 when the table shows the Top 5?
Should the user be able to change the value of the variable from one number to another number?

talk is cheap, supply exceeds demand
qlikuser222
Creator
Creator
Author

Should the text box show the number 2 when the table shows the Top 2? Yes
Should the text box show the number 5 when the table shows the Top 5? Yes
Should the user be able to change the value of the variable from one number to another number? If the user select just one dimension in the table then the variable value should show 1.

Gysbert_Wassenaar

If the user select just one dimension in the table then the variable value should show 1.

Do you mean dimension value instead of dimension?

For example: Country is a dimension and France, Belgium and Ireland are dimension values of the Country dimension.

 

Perhaps you want your variable to count the dimension values: =count(distinct MyDimension)


talk is cheap, supply exceeds demand
qlikuser222
Creator
Creator
Author

Like without any selections the text box should show count of 2. ( Possible count of that dimension is 7).

 

Can we use rank or some function to achieve this?

Gysbert_Wassenaar

Perhaps this: =rangemin(2, count(distinct MyDimension))


talk is cheap, supply exceeds demand