Evaluator Groups - wrong group selected

Based upon my example I've now added two more groups Yesterday and Yesterday (with error) and get a result in the lister that's not expected.

One of the files is sorted into group "Others" but should be inside group Yesterday (with error), because of it's creation date and the word "ERROR" in its filename.

Current coding is

if (is_dir) { return };

result = 11;

if ( DateDiff("d", Now(), value) == 0 ) { result = 1; }
 elseif( DateDiff("d", Now(), value ) == -1 ) { result = 3; }
   elseif( DateDiff("ww", Now(), value) == -1 ) { result = 5; }
    elseif( DateDiff("m", Now(), value) == -1 ) { result = 7; }
     elseif( DateDiff("yyyy", Now(), value) == -1 ) { result = 9; };

// increment the result when filename contains the word error
if (RegExS( name, "(.*)_ERROR(.*)" ) and result < 11 ) {
	result += 1;
};

return(result);

Those static groups are defined:
image

The file in question was created on 2024-01-04 (yesterday). So basically the line
elseif( DateDiff("d", Now(), value ) == -1 ) { result = 3; }
should be hit, result is 3, incremented by 1 because of the "ERROR".

Neither group Yesterday nor Yesterday (with error) is selected.

For debugging purposes, I did output the variable result and I can confirm that the value is 4 for this specific file. The lister, however, puts that file into the group Other.

FWIW, I've set up a different folder, configured the folder format identical to the above one and get the correct group Yesterday (with error).

The only difference is that the folder with wrong grouping is a network drive, whereas the later one is a local drive.

When dropping those lines

// increment the result when filename contains the word error
if (RegExS( name, "(.*)_ERROR(.*)" ) and result < 11 ) {
	result += 1;
};

the file in question is put into group Yesterday, which is correct.

So the question now is, why does the lister select the wrong group, when I increment the result by 1 or when choosing group 4?

Today, the same happened again. However, the misplaced file was created today and not yesterday (or with word error in filename).

The files in question are located in a network share, assigned to a drive letter.

The lister, that shows these groups, was already open (from last shutdown yesterday evening) while starting DO the first time today.
I happend that initially, DO froze for a while (because of the vast amount of files to group) and showed the today created file in group "Other". It should got into group "Today", though.

Obviously, the initial issue above, is not the only one that occurs when using evaluator groups. I first assumed it has to do with newly inserted static groups "Yesterday...", but this was not the case.

Again, when copying the file to a local drive, it gets sorted correctly:

Using the default scheme, groupd by Created (Date), the view is OK:

Returning back to my scheme, with evaluator columns, the file in question is grouped as expected:

All steps above, done w/o restarting DO, FWIW.

Check what you have set on the Grouping tab in the folder format for that folder.

image

I'm guessing you have it set to combine singletons in 'Other' group.

1 Like

Yes, unfortunately this was the cause of all troubles :face_with_open_eyes_and_hand_over_mouth:

1 Like