Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi all,
I need to hide the trend line that was created using linest functions when no selections are made. For example i have a combo chart with Month as it's dimension, and sum(Purchase) as one measure and Avg(Unit price) as other measure. When selections are made in Product column I need to show the trend line other wise just hide that line .
How to do this ?
any help will be appreaciated?
Note: I am able to show the trend line without any selections. Now i need to hide that and show it when I made some selections in product column.
Thank you

 Chanty4u
		
			Chanty4u
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		am nt sure
 
					
				
		
Thanks for the reply.
It's not a reference line but a trend line.
He goal is show when the selection is made on product column, it should show trend line other wise just bars as in bar chart.
 Chanty4u
		
			Chanty4u
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		u can create a text box over chart and apply show hide and layer shud be in top
 Gysbert_Wassena
		
			Gysbert_WassenaMake a copy of that expression without the trend line. Then use the conditional display option for both expressions to show/hide the expression (and the trendline for the expression that has one) with something like =len(GetCurrentSelections()) and =NOT len(GetCurrentSelections()) as conditional expressions.
 Chanty4u
		
			Chanty4u
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		i thnk this might
 
					
				
		
Hi Wassenaar,
I think i don't get, Make a copy of that expression??
My trend line expression is
LINEST_M(total aggr(avg([WA Price]),InvoicedMonth),InvoicedMonth)*InvoicedMonth+
LINEST_B(total aggr(avg([WA Price]),InvoicedMonth),InvoicedMonth)
And another measure is straight: sum(Price).
I think am clear with my requirement!!
 
					
				
		
Chanty, I tried it but it's not showing any effect when I apply the expression they discussed. By the way, I am doing it Qlik sense.
 Gysbert_Wassena
		
			Gysbert_WassenaOh, I thought you had enabled a trend line option on the bar expression. If the trend line is another chart expressions then you can use its conditional expression to show/hide it as needed with =Len(GetCurrentSelections()). Or if you only want to check selections in the Product field then =GetSelectedCount(Product)
 
					
				
		
Wassenaar,
If I am correct, we don't have any conditional expressions in qlik sense. So, I guess we have to write on the expression that we are using for trend line. Am I correct?
