Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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

Re: Limiting bars

See attached example.


talk is cheap, supply exceeds demand
Not applicable

Re: Limiting bars

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

Re: Limiting bars

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

Re: Limiting bars

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.

Re: Limiting bars

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

Re: Limiting bars

Thanks for your help.

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

version 2.2.3.0

Not applicable

Re: Limiting bars

mto

jagan

mayilvahanan

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

Employee
Employee

Re: Limiting bars

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

Re: Limiting bars

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

Community Browser