Skip to main content
Question

PQL logic to show Second Highest Vendor Name based on the sorting of Amount in a single KPI?

  • November 7, 2023
  • 1 reply
  • 14 views

mallik.koruk11
Level 6
Forum|alt.badge.img+8

I have to show top 3 vendors with pending balance in an email using Action flows. what PQL function can we use to sort top 3 vendors based on Amount column to apply same logic in Action flows?

 

Basically, these values are same as if we create OLAP table and sort by Amount, but these has to build in a single KPI component as 3 KPIs.

1 reply

I can't test it atm but I'd try INDEX_ORDER

https://docs.celonis.com/en/index_order.html

 

I.e create a filter with something like

 

FILTER INDEX_ORDER(amount, order by (amount)) <= 3

 

HTH