Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Alternate States as Dimension

Dear all,

 

I'm trying to use the Alternate States as a dimension and I cannot find a way to do it.

My problem is pretty simple:

I want to create a bar chart where to compare the data from the same location before and after a test (see below).

Is it possible to have something like below? 

                               IF (Alternate state = 'Before', 'This bar', IF(Alternate state = 'After', 'Another bar')

I have to say that adding it to the measure is not an option as the table is Stacked and I have multiple measures.

 

As a workaround, I'm loading data with an additional column (before or after) but it is not an elegant solution and it takes long to load it every time I want to compare another location.

Capture.PNGThe graph I want to build up

1 Solution

Accepted Solutions
Highlighted
Contributor III
Contributor III

If someone is interested in the solution, I have found a workaround as below.

I have added two empty variables as v_Before and V_After.

those variables can be manually changed by the user with Variable input feature from Qlik Sense.

The user can insert the variable as YYMM (representing the Year and Month which contain data as before and after).

Into the Dimension, I use a simple IF function which will filter the data before and after:

=IF(Meas_date= v_Before, 'Before',
IF(Meas_date= v_After, 'After')) 

View solution in original post

3 Replies
Highlighted
Contributor III
Contributor III

I've only been able to achieve this by wrapping with in an aggr function. Mind sharing your actual code?

Highlighted
Contributor III
Contributor III

Hello Sgagliardi,

 

Unfortunately, it contains sensitive data but is pretty simple:

Dimension - Field1

Measures - 4 measures which are stacked.

Actually, every field will have 4 stacked elements with 100% as a sum (as in the picture I have attached into the initial post).

Can you help me with understanding the aggr function you used?

 

Seems to be impossible until now to do it.

Highlighted
Contributor III
Contributor III

If someone is interested in the solution, I have found a workaround as below.

I have added two empty variables as v_Before and V_After.

those variables can be manually changed by the user with Variable input feature from Qlik Sense.

The user can insert the variable as YYMM (representing the Year and Month which contain data as before and after).

Into the Dimension, I use a simple IF function which will filter the data before and after:

=IF(Meas_date= v_Before, 'Before',
IF(Meas_date= v_After, 'After')) 

View solution in original post