Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
amirjabbar
New Contributor II

multiple condition on expression

hi.

i m trying to add multiple condition on expression formula colum

like fallowing are the condition

select count(e.EMP_ID)

from ATTENDANCE_NEW.LEFT_REJOIN l,ATTENDANCE_NEW.EMP e,ATTENDANCE_NEW.DEPT d

where e.EMP_ID=l.EMP_ID

and e.DEPT_ID=d.DEPT_ID

and l.STATUS in ('Resigned' ,'Weeded Out');

and i want to put this condition like this

COUNT( {<Status={'Resigned','Weeded Out'}>} Status)

9 Replies

Re: multiple condition on expression

Use this?

Where Match(Status,'Resigned', 'Weeded Out')

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
amirjabbar
New Contributor II

Re: multiple condition on expression

but here i need to count emp_id , and status condition are 'Resigned', 'Weeded Out'



this fallowing condition only count status , with condition 'Resigned', 'Weeded Out'


but i need to count emp_id


COUNT( {<Status={'Resigned','Weeded Out'}>} Status)


amirjabbar
New Contributor II

Re: multiple condition on expression

count(Emp_ID) Where Match(Status,'Resigned', 'Weeded Out')


will this correct

?

MVP
MVP

Re: multiple condition on expression

If your qv data model is properly associated (two tables are linked/joined with key field) , expression below might work:

COUNT( {<Status={'Resigned','Weeded Out'}>} emp_id)


Give a try.

Re: multiple condition on expression

Yes, But for Aggregate functions you may need Group By clause?? Like

Load Field, Status, Count(Emp_ID) as Count_Emp_ID Where Match(Status, 'Resigned','Weeded Out') Group By Field, Status;

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
amirjabbar
New Contributor II

Re: multiple condition on expression

but its expression for measure

i dont think so i measure group by works

amirjabbar
New Contributor II

Re: multiple condition on expression

ya qv data model is properly associated

and

seems correct but data is not correct

Re: multiple condition on expression

In UI, you can follow Tresesco solution, But you said, The values are wrong. How we know whether values are tested one or not.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

Re: multiple condition on expression

Would you be able to share an image of your data model?