Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
marwa_zerzeri
Contributor II
Contributor II

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
Partner - Creator
Partner - Creator

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

marwa_zerzeri
Contributor II
Contributor II
Author

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
Luminary Alumni
Luminary Alumni

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
Contributor II
Contributor II
Author

Ah ok Thank you Juraj