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: 
Not applicable

Limiting bars

Hello Everyone,

I am trying for a solution around how to limit the bars dynamically.

In my below bar graph, i want to limit the bars to 2 based on customers sum(Revenue) in desc order.

Dimensions - Customers

Measure -

if(((sum(Activity1)+sum(Activity2)+sum(Activity3)+sum(Pcost)+sum(Tcost))/sum(Revenue))>.1,

((sum(Activity1)+sum(Activity2)+sum(Activity3)+sum(Pcost)+sum(Tcost))/sum(Revenue)),

0)

Sorted expression - sum(Revenue) in desc order

data handling - not showing zero values.

any suggestion how to show only 2 bars for customers with sum(revenue) in desc order.

thanks, please refer the attached qvf.

Limit Bars.JPG

16 Replies
Gysbert_Wassenaar

See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert.

But this is not working. in the attached example i tried to show 4 bars and its not working in that case.

In a real scenario, i have customers in millions , for which i want to fix the no of limitations.

can you please check

Gysbert_Wassenaar

i want to limit the bars to 2
i tried to show 4 bars

Please make up your mind. Is it two or four bars you want to show?


talk is cheap, supply exceeds demand
Not applicable
Author

as an sample, i mentioned only 2.

but in a real scenario data, i have to show 20 bars.

My data is huge, around 1 million customer.

Also in your example, you have limit the bars with top 3, where as we are looking for top 2.

can you please check why you have set the limits to 3. instead of 2.

Gysbert_Wassenaar

Try the attached version. Note, it uses the qsVariable extension. You may need to install that extension first.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks for your help.

Any idea, i am getting errors while importing this into qlik sense enterprise.

version 2.2.3.0

Not applicable
Author

mto

jagan

mayilvahanan

Is it possible to achieve this requirement by writing an expression?/

Michael_Tarallo
Employee
Employee

Hi Prasanta,

I know that gwassenaar‌ is one of our star community members, so I am unsure if the answer I provide might be helpful or perhaps similar to what has been already provided. Have you looked into using the Dimension Limit feature for the Dimension value?

You can create a calculated expression related to the measure being used to limit the number of dimension values. Look at the input where the fx - symbol is - let me know how you do.

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

Regards,
Mike Tarallo
Qlik
Not applicable
Author

hi Mike,

Thanks for your reply. But dimension limit is not helpful here.

actually my requirement is bit different,

i want to limit the bars to a certain no based on customers sum(Revenue) in desc order.

Dimensions - Customers

Measure -

if(((sum(Activity1)+sum(Activity2)+sum(Activity3)+sum(Pcost)+sum(Tcost))/sum(Revenue))>.1,

((sum(Activity1)+sum(Activity2)+sum(Activity3)+sum(Pcost)+sum(Tcost))/sum(Revenue)),

0)

Sorted expression - sum(Revenue) in desc order

data handling - not showing zero values.

please refer the attached qvf in my original post

Regards,

Prasanta