Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
Partner Ambassador Affiliate
Partner Ambassador Affiliate

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