Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

marwa_zerzeri
New Contributor

two reference lines in a line chart

Hello,

I made a line chart that contains two dimensions ([Month Year] and [DATE]) and a single measure (Outstanding savings). The [DATE] is an alternative dimension. I want to display for each dimension selected in the graph the appropriate reference line.

In the expression of the reference line, I did as follows but it always shows me the same reference line (the conition in the if always returns  False):

= if ([Month Year] = [Month Year],

avg (aggr (Sum ({$ <[Line Type] = {"Savings Outstanding"}, [Flag End Month] = {"1"}>} Balance), [Month Year])),

avg (aggr (Sum ({$ <[Line Type] = {"Savings Outstanding"}>} Balance), [DATE]))

)

I need to know the good condition. Thanks for your help.

4 Replies
joseph_eftamand
Contributor

Re: two reference lines in a line chart

'[Month Year] = [Month Year]' can you explain this condition?

marwa_zerzeri
New Contributor

Re: two reference lines in a line chart

The line chart contains two dimensions ([Month Year] and [DATE]). So, if '[Month Year] = [Month Year]' means if the dimension [Month Year] is selected .

juraj_misina
Valued Contributor

Re: two reference lines in a line chart

Hi.

If this is Qlik Sense, I don't think it is doable. In QlikView with Cyclic dimensions there was a function GetCurrentField() which was doing exactly what you need, but this is not available in Qlik Sense:

https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/Scripting/QlikView-functions-state...

Juraj

marwa_zerzeri
New Contributor

Re: two reference lines in a line chart

Ah ok Thank you Juraj

Community Browser