Delphi please let me know why my filter not work :     test := TFDMemTable.Create(nil);
    test.CopyDataSet(TempUnplannedDemand, [coStructure, coRestart, coAppend]);
    test.First;
        while not test.Eof do
        begin
          ShowMessage(DateTimeToStr(test.FieldByName('demand_date').AsDateTime) +
                    ' - ' +
                    IntToStr(test.FieldByName('level').AsInteger));
          test.Next;
        end;

will show  
24/03/2017 - 1  
24/03/2017 - 0  
24/03/2017 - 1  
24/03/2017 - 1  

      test.IndexFieldNames := 'level';
    
      //test.SetRangeStart;
      //test.FieldByName('level').AsInteger := 0;
      //test.SetRangeEnd;
      //test.FieldByName('level').AsInteger := 0;
      //test.ApplyRange;
    
      //test.SetRange([0],[0]);
    
      test.Filter := 'level=0';
      test.Filtered := True;
    
      test.First;
      while not test.Eof do
      begin
          ShowMessage(DateTimeToStr(test.FieldByName('demand_date').AsDateTime) +
                    ' - ' +
                    IntToStr(test.FieldByName('level').AsInteger));
          test.Next;
        end;

will show   
24/03/2017 - 1  
24/03/2017 - 0  
24/03/2017 - 1  
24/03/2017 - 1  

why test.Filter := 'level=0'; don't work  

Please help me.