Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Anil_Babu_Samineni

Use this?

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

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)


Anonymous
Not applicable
Author

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


will this correct

?

tresesco
MVP
MVP

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.

Anil_Babu_Samineni

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;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

but its expression for measure

i dont think so i measure group by works

Anonymous
Not applicable
Author

ya qv data model is properly associated

and

seems correct but data is not correct

Anil_Babu_Samineni

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

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