Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
raju_insights
Partner - Creator III
Partner - Creator III

How to nullify the selection in this bar chart !!! Little tricky !!

Hi Techies,

For this bar chart, I have some conditions, please help me to achieve that.

Tricky Bar chart.JPG

Conditions:

1. Colors are fixed (ash and blue)

2. The chart should not change on selection. For example, if I select kamal or any name the chart should remain same.

How do I nullify the selection !!!

Here I have attached a sample app to play around.

8 Replies
Anonymous
Not applicable

For the colours change the colour to expression and then use an expression like;

If (year = 'CY', RGB(165,165,165), if(year = 'PY', RGB(90,155,213)));

To stop the chart changing on selections you need to place a {1} in your expression, something like;

=sum({1}Value)

The {1} marker defines the record set to ALL.

Thanks

raju_insights
Partner - Creator III
Partner - Creator III
Author

Hi Gareth wilson,

For colors I have already done what you said. But for selection {1}  is not working. Because, even when I select Kamal

it should display like thisTricky Bar chart.JPG

and not like this

Sample 2.JPG

Anonymous
Not applicable

Could you post the expression, I havent got sense on this laptop to open the app

raju_insights
Partner - Creator III
Partner - Creator III
Author

Hi Gareth Wilson,

Here I have attached qlik view app.

Expression:

IF(type='CY' ,sum({1}CYSales),

if(type='PY',SUM({1}PYSales)))

NOTE: My requirement is for qlik sense.

Anonymous
Not applicable

The if statement is throwing off the set analysis marker.

try using

sum({1}if(type='CY',CYSales,PYSales))

!

Anonymous
Not applicable

And for your colours;

You create expressions for colors in the properties panel.

Do the following:

  1. In the properties panel, open Appearance > Colors and legend.
  2. Click the Colors button to switch to Custom.
  3. In the drop-down list, select the option By expression.An expression text box is opened.
  4. Enter If (type = 'CY', RGB(165,165,165), if(type = 'PY', RGB(90,155,213))) in the text box
raju_insights
Partner - Creator III
Partner - Creator III
Author

Hi Gareth Wilson,

Excellent!!!

But I have a catch here. In real scenario I will use something like this (should have mentioned earlier),

Expression:

IF(type='CY' ,sum({<$(vSetForCurrentYear)>}Sales),

if(type='PY',SUM({<$(vSetForPreviousYear)>}Sales)))

in this case I can not put the sum outside if.

How do I achieve this....

shraddha_g
Partner - Master III
Partner - Master III

In this case try using

IF(type='CY' ,sum({1<$(vSetForCurrentYear)>}Sales),

if(type='PY',SUM({1<$(vSetForPreviousYear)>}Sales)))