How to leave only part of a string in the dataview output?

Hi I am using the following code to output all folders and the contents of those folders in dataview:

list rows.file.link 
FROM "Тестовая область/1 КПТ/Карвасарский" 
sort file.name asc group by file.folder 
sort file.name asc

I see this result

But you need only the last folder name to remain, as in the picture below.

How to do it? Thanks a lot.

Please check if it works:

LIST rows.file.link 
FROM 
    "Тестовая область/1 КПТ/Карвасарский" 
FLATTEN 
    regexreplace(file.folder, ".*\/([^\/]+)$", "$1") as parent_folder_name
SORT 
    file.name
GROUP BY 
    parent_folder_name 

.

If you do futther, I think you can start from the example.

Amazing. Thanks a lot!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.