Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

michellesparke2
New Contributor

Dimension expression using multiple conditions

I have my QlikSense linked to an ODBC database.  The tables have history information in many fields. I need to set up a dimension that will only count based on conditions.

An example is a Dimension called "ActiveEngagement".  This will have the following conditions:

VariationActive = 1

CurrentRecord = 1

VariationStatus != Separated

VariationReason != Separation

How do I put this into an expression?

Thank you

1 Solution

Accepted Solutions
luismadriz
Valued Contributor

Re: Dimension expression using multiple conditions

Hi, i think you could create a filter pane with this as the dimension:

=if(Active=1 or CurrentRecord = 1 or EmploymentStatusId <> 9 or VariationReasonId <> 23,'Active','Inactive')


It won't get default it but you can control it,


I hope this helps,


Cheers,


Luis

4 Replies
mark6505
Valued Contributor III

Re: Dimension expression using multiple conditions

Hi,

Are you just after the Set Analysis to count the given field with the conditions applied?

COUNT({<VariationActive = {1},CurrentRecord = {1}, VariationStatus -= {'Separated'}, VariationReason -= {'Separation'}>}ActiveEngagement)

Mark

michellesparke2
New Contributor

Re: Dimension expression using multiple conditions

Thanks so much Mark.  Sorry my bad terminology, I don't want it to count, but I would like to use it as a Master Dimension. So returning only active engagements.

Actually, could I add a field in the table with "Active" if true, "Inactive" if false. The conditions would be something like :

if(Active=1 and CurrentRecord = 1 and EmploymentStatusId -= 9 and VariationReasonId -= 23,Yes,No)

Michelle

michellesparke2
New Contributor

Re: Dimension expression using multiple conditions

Hi again, ok I have been working on this for a couple of days.  There are 4 indicators why an Engagement will be active, so all of the above conditions are in 1 table with the key field being VariationID and would have to be "OR".  I am not sure how to do this, I want the entire dashboard to default to show only Active Engagements, but be able to select Inactive - maybe a switch or toggle in the left corner.  My dashboard looks like this:

What would be the best way to do this?

Thanks

Michelle

luismadriz
Valued Contributor

Re: Dimension expression using multiple conditions

Hi, i think you could create a filter pane with this as the dimension:

=if(Active=1 or CurrentRecord = 1 or EmploymentStatusId <> 9 or VariationReasonId <> 23,'Active','Inactive')


It won't get default it but you can control it,


I hope this helps,


Cheers,


Luis