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

How to write set analysis expression (multiple conditions) with AND / OR operators?

My data looks like the table below:

LoadDateEmpIDLevelStatusWages
01-Jan-2014100M2ONBOARD10000
31-Jan-2014100M2ONBOARD10000
28-Feb-2014100M2ONBOARD12000
31-Mar-2014100M2ONBOARD12000
30-Apr-2014100M2ONBOARD12000
31-Mar-2014120M1XFER_IN13000
30-Apr-2014120M1ONBOARD13000
01-Jan-2014130M1ONBOARD12000
31-Jan-2014130M1ONBOARD12000
28-Feb-2014130M1PROM_OUT12000
28-Feb-2014130M2ONBOARD12000
28-Feb-2014130M2PROM_IN15000
31-Mar-2014130M2ONBOARD15000
30-Apr-2014130M2ONBOARD15000

I wish to write an expression that will count distinct employees who have a transaction with status "ONBOARD" on 01-Jan-2014 and 30-Apr-2014 (continuing employees) including any promoted during this period . The table dimension is grade as displayed the expected results. The expression used by me is not producing the right results.

LevelOp HCOp WagesProm_In HCProm WagesPost Inc HCPost Inc Wages
M1112000--112000
M2110000115000227000

Advance thanks.

2 Replies
swuehl
MVP
MVP

Sorry, I haven't fully understood what you want to accomplish (especially looking at your second, expected table).

In general, there are set operators for Union, Exclusion, Intersection and XOR, so chances are that you can do what you want using these oeprators. Have a look at the Help for more detail or detail your requirements.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think one way would be:

=count({

<EmpID=P({<LoadDate={"01-Jan-2014"},Status={ONBOARD}>})>

*<EmpID=P({<LoadDate={"31-Mar-2014"},Status={ONBOARD}>})>

}DISTINCT EmpID)

-Rob