Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
michellesparke2
Contributor
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
Specialist
Specialist

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

View solution in original post

4 Replies
Mark_Little
Luminary
Luminary

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
Contributor
Contributor
Author

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
Contributor
Contributor
Author

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
Specialist
Specialist

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