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: 
RCDP
Contributor II
Contributor II

Custom field based on a count condition on another field

Hello,

I'm new to Qlik and I've implemented a report based on call registry of a call center.

Qhat I'm trying to do is to generate a custom field (boolean Yes or No) based on a count condition.

If I count for the same call ID (uniqueID) more than one record and at least one of them have no operator information (detailOperatorExten) I have to mark che custom field "Owerflow" with Yes, else if all record have no operator information No.

Could you please help me?

Thanks

Riccardo

1 Solution

Accepted Solutions
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

maybe you could try something like this

TABLE:
LOAD * Inline [
uniqueID,status,detailoperationexten
1,served,101,
2,served,
2,served,201
3,not served,
3,not served,
4,not served,
];

Left Join (TABLE)
LOAD
uniqueID,
Count(uniqueID) as CountID
Resident TABLE
Group By
uniqueID
;

Left Join (TABLE)
LOAD
uniqueID,
Count(detailoperationexten) as Countdetail
Resident TABLE
Where Len(Trim(detailoperationexten))=0
Group By
uniqueID
;

NoConcatenate
OUTPUT:
LOAD
uniqueID,
status,
detailoperationexten,
If(CountID>1 and Countdetail<>0,'Yes','No') as Overflow
Resident TABLE;

DROP Table TABLE;

View solution in original post

5 Replies
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

What if all records has operation info? Display yes?

 

RCDP
Contributor II
Contributor II
Author

uniqueIDstatusdetailoperationextenOverflow
1served101No
2served-Yes
2served201No
3not served-Yes
3not served-No
4not served-No

 

uniqueID, status and detailoperationexten all come from a CSV file. The "Oweflow" is a custom field that need to tell me if a call was passed to another queue when the first queue did not answer in time.

So in this scenario the call 2 and 3 are that on which I have to mark this info.

Hope to be clear enough.

Thanks 

Brett_Bleess
Former Employee
Former Employee

Riccardo, I am going to give you a URL link to the Design Blog area of the Community, you will find a bunch of examples of how to do different things there, not sure there is anything specific related to your current scenario, but you may find some things that will give you some other ideas as well.  

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

With my post, things will be kicked back up in the list again, so someone else may shout back again given you posted the extra info...  Just wanted to try to give you something in the meantime, sorry I am not more help to you.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

maybe you could try something like this

TABLE:
LOAD * Inline [
uniqueID,status,detailoperationexten
1,served,101,
2,served,
2,served,201
3,not served,
3,not served,
4,not served,
];

Left Join (TABLE)
LOAD
uniqueID,
Count(uniqueID) as CountID
Resident TABLE
Group By
uniqueID
;

Left Join (TABLE)
LOAD
uniqueID,
Count(detailoperationexten) as Countdetail
Resident TABLE
Where Len(Trim(detailoperationexten))=0
Group By
uniqueID
;

NoConcatenate
OUTPUT:
LOAD
uniqueID,
status,
detailoperationexten,
If(CountID>1 and Countdetail<>0,'Yes','No') as Overflow
Resident TABLE;

DROP Table TABLE;

RCDP
Contributor II
Contributor II
Author

Thanks, it works!