Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bar Chart: No selections = New unnamed bar

I have a vertical bar chart created from a cross table of info.  I have one list box where I can make selections and the chart shows the data distributed across the bars accordingly. 

When no selections are made, I would like the bar chart to display as if 'all options' are selected and distributed throughout the chart.  However, when I do not select from my list box (all white options), the vertical bar chart creates a new bar on the far right of my graph with the value "  '  " and sums all data into this 1 bar. 

Once a selection is made, the values are distributed across the chart, with proper values, as needed. I need the values to distribute when no selection is made.  Any help is much appreciated.

PS my chart has X axis values shown in ranges (10-20, 21-30, etc..).  These 'buckets' can be adjusted for size with a slider.  When list box selections are made, this slider performs the way I need it to.

7 Replies
ali_hijazi
Partner - Master II
Partner - Master II

on the dimension tab check the suppress when value is null option

if you want to display the selections that you made from the list box use the functin concat

concat(distinct your_field,',')

I can walk on water when it freezes
Not applicable
Author

No change in display after suppressing null values...

here is my dimensions script.  where are you suggesting i add the concat function?

=SubField(Class([Income ranges],IncomeBuckets,'IncomeRange'),' ',1)&'- '&SubField(Class([Income ranges],IncomeBuckets,'IncomeRange'),' ',5)

PrashantSangle

Hi,

Try with len()

like,

len(SubField(Class([Income ranges],IncomeBuckets,'IncomeRange'),' ',1)&'- '&SubField(Class([Income ranges],IncomeBuckets,'IncomeRange'),' ',5)>1,SubField(Class([Income ranges],IncomeBuckets,'IncomeRange'),' ',1)&'- '&SubField(Class([Income ranges],IncomeBuckets,'IncomeRange'),' ',5))

and then tick supress null value in dimension tab.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

thanks max, Im not sure if this is best. it eliminates all buckets and creates an error.  unfortunately i don't know the len() function well enough to identify the error in your example...

PrashantSangle

Hi,

My bad,

I am trying to suggest you to use inside if()

Like

if(len(yourscript)>1,youscript)

then tick suppress null values.

Try this,

=if(len(SubField(Class([Income ranges],IncomeBuckets,'IncomeRange'),' ',1)&'- '&SubField(Class([Income ranges],

IncomeBuckets,'IncomeRange'),' ',5))>1,(SubField(Class([Income ranges],IncomeBuckets,'IncomeRange'),' ',1)&'-'&SubField(Class([Income ranges],IncomeBuckets,'IncomeRange'),' ',5)))

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

tks. your string performs the same way...  still getting a bar when no selections are made at the end of the chart.  value= '

Is there a way to lock a list box selection so that, when no selection(s) is made, there is a default single selection among 10 choices?  This would solve the issue.

PrashantSangle

Hi,

You can try with

create a trigger.

Go to Sheet Property->Triggers->On activate Sheet->Add Action->Add->Selection->

1)select in field

2) Lock Field

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂