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.
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.
Make 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.
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!!
Oh, 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)
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?