Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
antoinea
Partner - Contributor
Partner - Contributor

Using 2 Alternate States as a dimension (in a line chart)

Hi there,

First time I'm using the alternate states and I'm wondering if what I want to do is doable.

So I have 2 date pickers (range selectors), each of them linked to a different state. The idea is then to be able to select 2 different date ranges and see them on the line chart, one line for each (see pic attached).

I tried to create a line dimension as follows:

=If(GetSelectedCount([Date], True(), 'Date Period') > 0
  , 'Date Period'
  , If(	GetSelectedCount([Date], True(), 'Comparison Period') > 0
  		, 'Comparison Period'
        , Null()
    )
)

 

I understand why this doesn't work but this is basically the dimension I would like to fix. It should split the single line in the attached picture into 2 points (one for each alternate state) with different colors.

Any idea how to do that?

Thx!

Antoine

Labels (2)
1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

This is totally doable, but you are going about it the wrong way, making it too hard.

Month will be your dimension and you are going to apply these date selections to different alternate states, which you then apply to two separate measures inside set analysis.

View solution in original post

2 Replies
Lisa_P
Employee
Employee

This is totally doable, but you are going about it the wrong way, making it too hard.

Month will be your dimension and you are going to apply these date selections to different alternate states, which you then apply to two separate measures inside set analysis.

antoinea
Partner - Contributor
Partner - Contributor
Author

Thank you @Lisa_P , you're right I was looking at it the wrong way, and I don't even know why I didn't think of splitting this into 2 separate measures...

It works like a charm now 🙂