Quintiq file version 2.0
#parent: #root
Method FilterDataOnSelectedKpis (
  structured[KpiMetaData] filterKpis,
  KpiLabel series,
  Boolean isLastSnapshotChecked
) as String id:Method_GlobalStateKpiTracker_FilterDataOnSelectedKpis
{
  #keys: '[146874.0.1589191753]'
  Body:
  [*
    // Sets the filter on the KpiValues list to match the selected KPIs and the
    // LastSnapshotOnly checkbox.
    filter := "";
    
    if( not isnull( filterKpis ) and filterKpis.Size() > 0 )
    {
      filter := "( " + this.GenerateFilterFromKpiSelection( filterKpis ) + " )";
    
      if ( isLastSnapshotChecked and not isnull( series ) )
      {
        filter := filter + " and ( object.UI_IsLast() )";
      }
      debuginfo(' >>> Setting list filter to ' , filter );
    }
    
    return filter;
  *]
}
