Skip to main content
Game strategy with X's and O's.

How do I… Use PQL to create custom filters?

Martin Cook, 7 minute read
Welcome to the sixth entry in our "How do I…?" series on Pega Process Mining. Join us as we explore the fundamentals of becoming a world-class Pega Process Miner, from prepping your case types to identifying opportunities for improvement! To learn more or catch up on the series, please visit the Pega Process Mining discussion on Support Center

Welcome to another entry in our monthly series on how to get the best out of Pega Process Mining. If you’re feeling glum that the festive season is over, I have good news — PQL Clause is coming to town! 

In this month’s Blog post, we’ll look at how to use the easy-to-learn, SQL-based PQL clauses in Pega Process Mining to set up advanced named filters for your processes. 

What are named filters?

With named filters, you can quickly jump to a subset of Cases in your Process View without having to click through the UI every time.  

Accessing your named filters is easy: in a View, in the header of the application, click the Data Filters icon, as shown in the following image: 

Filter icon.

Clicking the icon opens the Filters dialog box, which lists all active filters (which is where you can save them as named filters) and where, on the Named Filters tab, you can find any existing named filters. 

With named filters, you can quickly jump to a subset of Cases in your Process View

 

Creating named filters

So, how do I set up a named filter? Simply open the Filters dialog box, and click the Advanced Filters tab. 

The Filters dialog box.

The Filters Clause text box is where we enter our PQL logic. We can give the filter a name in the field under that, and we can even share this filter with other users by using the Share with groups option. 

Types of PQL filters 

Named filters support a range of different PQL commands. In this next section, we’ll look at a Workforce Management process: 

Diagram of a process map in Pega Process Mining.

I have a few different scenarios that I regularly need to investigate in this process. Named filters will really help me quickly jump to each of these views: 

  1. There should not be any delays between the Accepted Step and On the Way; we do not want our customers to wait before receiving help because of the misrouting of the Case.  
  2. When Cases are rejected, they go back through the process, which creates rework. I want to see when this happens, and the Case ends up being canceled anyway, which causes us double the waste. 
  3. I want to quickly see the Cases that fail so that I can begin to analyze the root cause. 
  4. Wasted journeys cost our organization money, so I want to see all the occasions where a Case got to On the Way but was then canceled. 

So, let’s get some filters set up to make this nice and easy! 

Scenario 1. Delays between Accepted and On the Way 

First, let's look at when we’ve gone straight from Accepted to On the Way. For this filter we can use the ‘executes()’ function.  

‘executes(Accepted,On the Way)’ will filter all Cases that routed directly to On the Way after the Accepted Step. 

The pathway of Accepted to On the Way Cases. 

We can see that 79 percent of Cases went straight to On the Way, which is great! 

By using the powerful filtering features of Pega Process Mining, I can simply invert this filter to see all the occasions when Cases did not follow the path of Accepted to On the Way: 

Filtered Cases that are either Assigned of Opened.

This information, however, still includes all occasions where either Accepted or On the Way were not hit. I want to see when we did hit these but didn’t go straight between them. 
Another named filter can help us with this: executes(Accepted,*,On the Way), in combination with our previous filter, gives us what we need.

Filtering Accepted Cases that are now on the way.

The executes() function is a great way to specify a string of activities that you are interested in analyzing! 

Scenario 2: Rejected and Canceled 

If we want to see when two activities are both present in a process, we can use cooccur(). 

Because we want to see when both Rejected and Canceled are encountered, the filter we need is cooccur(Rejected,Canceled). 

Cooccurrence of Rejected and Canceled Cases.

cooccur() enables us to very easily jump to cases containing two events regardless of the order in which they occur. 

Scenario 3: Failed Cases 

To be able to jump to Cases that hit Failure without having to find and click the node in the map, we can set up a named filter that has ‘alwaysOccurs(Failure)’ in its logic.  

Number of Cases that failed.

With ‘Alwaysoccurs()’, we can filter Cases where the specified activity has happened, which is a great shortcut to filtering complex maps without having to find that activity in the UI if you already know exactly what you are looking for. 

Scenario 4: Wasted journeys 

To find all the Cases where they were first moved to On the Way and then were Cancelled anyway, I can use the ‘existCausal()’ clause. ‘existCausal(On the Way,Canceled)’ then surfaces all the times when the Case encountered On the Way before reaching Canceled. 

Number of Cases that were On the Way before reaching Canceled.

As, we can see, there are quite a lot of wasted journeys! ‘existCausal()’ is a fantastic tool to see when one event occurs before another without having to specify a particular flow like in ‘executes()’. 

Named filter list 

Now that I have all my named filters saved, how do I use them? 

Let's head back to the Filters dialog box used to create each named filter and click the Named Filters tab. 

Named filters tab.

Here, we can find all the filters we created and apply them by clicking the Filter icon in their row. 

So that’s it — now you know how to apply PQL in your named filters! We’ll see you next month for more in our “How do I?” series about Pega Process Mining.  

 

Related Resources

Don't Forget

About the Author

As a product manager, Martin works to capture client and market needs to drive the direction of Process and Task Mining development at Pega.

Share this page Share via X Share via LinkedIn Copying...

Did you find this content helpful?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice