Jump to content

Recommended Posts

Posted

A very simple approach to do something like select distinct in SQL to return number of distinct entries. For ex.  in the following table i want to find how many kitchens are currently being used for Marinara. I was able to extend the pandas example for the new python feature to search through the table and return number of kitchens being used for Marinara. 

KitchenMap.png.61bdb2bf339833af8e88254ccca08c5a.png

'PandasSelectDistinct' step lets users define the columns to filter and conditions for filtering. Users also need to define 'GroupList' , column to group by and 'DistinctList' column to count distinct entries. For ex. in this scenario table is filtered on Processed==false and KitchenAssigned == true.  Group by ItemName and distinct by Kitchen. Entity triggering the process is 'Marinara' step will return 2. This method can be extended to return actual kitchens being used as well. 

SelectDistinct.thumb.png.7d43ab1532b8e50724eb0e05b3a66a26.png

To define filter conditions use 'Column Name1' == 'Value', 'Column Name2'=='Value'.....etc.

 

I am using model/script from Pands Date Frame from Table on git hub.SelectDistinctFromTable.spfx

I have not tested the model extensively. Just a starting point for something I wanted to do for a long time.

 

×
×
  • Create New...