Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rustyfishbones
Master II
Master II

Select Top Five Files but what about spaces?

Hi All,

I have the following expression used in a Select in Field to Select the 5 biggest files based on File Size

'(' & CONCAT(IF(AGGR(RANK(SUM(Size)),[Full Path])<=5,[Full Path]),'|') &')'

however it does not work, I believe it's because there are spaces in the Full Path name

What can I add to the above expression to resolve it

Regards

Alan

1 Solution

Accepted Solutions
marcus_sommer

Maybe you need each value wrapping in single/double-quotes, like:

'(' & chr(39) CONCAT(IF(AGGR(RANK(SUM(Size)),[Full Path])<=5,[Full Path]), chr(39) & '|' & chr(39)) & chr(39) &')'

- Marcus

View solution in original post

4 Replies
rustyfishbones
Master II
Master II
Author

btw

the expression returns the correct result and shows me the 5 files, however it does not select them

Regards

Alan

marcus_sommer

Maybe you need each value wrapping in single/double-quotes, like:

'(' & chr(39) CONCAT(IF(AGGR(RANK(SUM(Size)),[Full Path])<=5,[Full Path]), chr(39) & '|' & chr(39)) & chr(39) &')'

- Marcus

rustyfishbones
Master II
Master II
Author

I was thinking of that too but it does not work

rustyfishbones
Master II
Master II
Author

Actually, I just replaced CHR(39) with CHR(34)

And it worked

So the working Expression is

='(' & chr(34) & CONCAT(IF(AGGR(RANK(SUM(Size)),[Full Path])<=5,[Full Path]), chr(34) & '|' & chr(34)) & chr(34) &')'