Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional expressions

I have a field named Controlxx. The value can be 'Partially Effective' , 'Ineffective', 'effective'. I am trying to count up the records for a bar chart where the value can be 'Partially Effective' , or 'Ineffective'  .

My dimension is a field named 'Control'.  I am unable to get this to work. Can someone shed some light for me.

What is the proper syntax?

Thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

What this Control dimension contain?

You can take Control as Dim & Expression is:

=count({<Controlxx={'Partially Effective' , 'Ineffective', 'effective'}>} Controlxx)  //you can use distinct as well

Hope this will help!!

View solution in original post

7 Replies
Kushal_Chawda

try

count ({<Controlxx={'Partially Effective' , 'Ineffective'}>} Amount)

punitpopli
Specialist
Specialist

Hi erodman52‌,

Please find the attached sample file and let me know if this works for you.

Thanks,

Punit !

Anonymous
Not applicable
Author

I wud say, in a meaningful way:

Take Controlxx as dimension and Count(Control) or count(distinct(Control)) as expression.

Mark_Little
Luminary
Luminary

Hi,

What exactly are you trying to show on the Bar Chart?

Is it two bars one showing the 'Partially Effective' , 'Ineffective' and another showing 'Effective'?

If so you could use two expressions

count ({<Control={'Partially Effective' , 'Ineffective'}>} Control)

And

count ({<Control={'Effective'}>} Control)

or you could make another field in the script that groups the two for your charts

IF(Control={'Partially Effective' , 'Ineffective', 0, 1)  AS Effective.

The 0 and 1 are just flag and could be anything you need.

Mark

Anonymous
Not applicable
Author

What this Control dimension contain?

You can take Control as Dim & Expression is:

=count({<Controlxx={'Partially Effective' , 'Ineffective', 'effective'}>} Controlxx)  //you can use distinct as well

Hope this will help!!

Not applicable
Author

Thank you for solving my issue. I used the same construct on another bar chart, containing two dimensions.

In this case the value could be 'E', or 'M'. I get the correct values, but the first line of the chart does not contain a value, it is blank, but it contains 1175 as the count. It is skewing the other values, as I don't see the individual lines of the graph because the numbers ae small.

Anonymous
Not applicable
Author

You can use Suppress Null Values Option in Dimension Tab