Front End Qlik Bar Chart Manipulation (Combine/ CONCAT 2 bars)

31 Views Asked by At

I have a barchart that is pulling from the below table:

Status Person
Active 1 90
Active-in progress 79
Submitted 34

The goal here is to combine 'Active-in progress' with 'Submitted' and make it 1 bar on the bar chart. This must all be front end code.

Currently within the dimension i have this code

If(Status<> '', Status, if( Status='Active 1' and status = 'Submitted', Concat(status)

The first line of code is to make sure to only include non empty fields. This part works on its own. However the second if statement doesnt.

Please help

1

There are 1 best solutions below

0
On

The problem with your expression is that it first check if the value is not empty (Status <> '') and if true then returns the original value, else will perform the second part.

So techincally this expression will return the original value for all non empty values and will perform the second part for all empty/null values.

You'll have to swap the logic in order to perform the runtime mapping:

= if(Status <> '', 
   if( Status = 'Active 1' or Status = 'Submitted', 
       'Combined', 
       Status
   )
)

Resulting chart:

Result chart

As mentioned in the other question, try and solve these in the load script. Using calcualted dimensions leads to performance implications in larger apps.