Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

Bar Chart Freeze

Hi  qlik tech experties

below is my data

Name Sales
xxx1 100
xxx2 200
xxx3 300
xxx4 400
xxx5 500
xxx6 600
xxx7 700
xxx8 800
xxx9 900
xxx10 1000

 

To calculate the bottom 20% in the bar chart,

 dim is : Name

exp is : if(RangeSum(Above(SUM(Sales),0,RowNo()))/SUM(TOTAL(Sales))<=0.20,SUM(Sales)) 

sorted the chart dim to desc with exp sum(sales) . chart showed the data correctly. below is the reference.

 

problem:now my user is telling when i select any bar  in the botom 20 % chart that has to be freezed.

example if we select the name dimesnion in the chart or name filter inthe ui the bottom 20% bar chart should not change.

others filter like year or any other filter the chart has to change.

how to achive this.

 

manoranjan_d_0-1646852793645.png

 

 

 

Labels (4)
9 Replies
Digvijay_Singh

not sure if this would work but you may try, the outer if might create trouble but to disregard any selection we normally use 'Fieldname=' in the set expression, it has to be added wherever set expression is allowed in the expression - 

if(RangeSum(Above(SUM({<Name=>}Sales),0,RowNo()))/SUM({<Name=>}TOTAL Sales))<=0.20,SUM({<Name=>}Sales))

anthonyj
Creator III
Creator III

Hi @manoranjan_d ,

I got this one to work using rank and fieldvaluecount functions.

if(rank(Sum({$<Name=>}Sales))/FieldValueCount('Name') >=.8, sum({$<Name=>}Sales))

Thanks

Anthony

manoranjan_d
Specialist
Specialist
Author

@Digvijay_Singh   this is not working.

manoranjan_d
Specialist
Specialist
Author

@ anthonyj

This chart is to calcualte to 20% above experssion works only for ranking to get the top names. so any other suggestions much appreciated  

anthonyj
Creator III
Creator III

Hi @manoranjan_d ,

@Digvijay_Singh 's code is correct. It removes the interaction of the graph with the [Name] dimension. There is just one too many close brackets after Total Sales. If you copy in like below I've removed the extra bracket.

if(RangeSum(Above(SUM({<Name=>}Sales),0,RowNo()))/SUM({<Name=>}TOTAL Sales)<=0.20,SUM({<Name=>}Sales))

Regards

Anthony

manoranjan_d
Specialist
Specialist
Author

Hi Anthonyj 

sorry for the delay repsonse 

I tried above exp its not working . if  i select any  bar then its getting changed and from the name list also it getting changed

 

before selection

manoranjan_d_0-1647331733210.png

 

after selecting any one bar example xx3 the chart has to  freeze it should not chnage, but ot gettign changed

manoranjan_d_1-1647331771360.png

 

 

manoranjan_d
Specialist
Specialist
Author

hi anthonyj

i found something to make freeze the bar chart in qlikview , Pease check "Read Only" at General Tab

so the chart will be freezed , but selectng the name list also it should not change

manoranjan_d
Specialist
Specialist
Author

Hi qlik experties,

 

any help or suggestions for my issue

anthonyj
Creator III
Creator III

Hi @manoranjan_d ,

I see the issue. In your screen shot I can see another column you're filtering on called [ID]. The solution provided includes a set analysis {<Name=>}. What this does is prevents any interaction with the [Name] field but all other fields would still cause interaction. You have two choices:

If [ID] is the only other field the user can interact with then you can add it to all the set analysis like below:

{<Name=, ID= >}

If you have a lot of columns they can choose from and you don't want the graph to change at all, you can replace {<Name=>} with {1}. This locks down the whole visualization and it won't be affected by any filters.

if(RangeSum(Above(SUM({1}Sales),0,RowNo()))/SUM({1} TOTAL Sales)<=0.20,SUM({1}Sales))

This should do the trick.

Thanks

Anthony