Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Is there a nicer way to skip the empty lists resulting from this query?

 str:"hello world"
 extract list value where 1<count index by value from str 
((),(),("l","l","l"),("o","o"),(),(),(),())
Right now I have

 (list ()) drop extract list value where 1<count index by value from str 
(("l","l","l"),("o","o"))

  With the aim of showing only repeat elements, so

 "" fuse first @ (list ()) drop extract list value where 1<count index by value from str 
"lo"
 "" fuse first @ (list 0) drop extract first value where 1<count index by value from str
"lo"
 "" fuse extract L where C>1 from select L:(first value) C:count value by value from str 
"lo"
(+1)

You could use a conditional to compute the extracted column (this is evaluated once per group):

extract if count value first value else () end where 1<count index by value from str

Or you could use the "gindex" column to make the filter retain at most one element per group:

extract where (!gindex)&1<count index by value from str

How's that?

(+1)

Both of those work! I didn't know about gindex, and that seems useful. I kept looking for some way to have a 'where' apply after an earlier 'where' without multiple queries, and the conditional shows a way to do that.

The conditional also suggests this solution:

 extract () unless first value where 1<count index by value from str