File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
src/app/components/widgets Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -2138,18 +2138,25 @@ export class BaseWidget implements OnInit, OnDestroy {
21382138 private applyFilters ( filters : IFilter [ ] ) {
21392139 const active = filters . filter ( flt => {
21402140 // Skip all apply variable filters
2141- if ( flt . action === 'applyVariable' ) {
2141+ if ( flt . action === 'applyVariable' ) {
21422142 return false ;
21432143 }
21442144 return flt . value !== '' ; // && !flt.isInterval
21452145 } ) ;
21462146
2147+ if ( active . length === 0 ) {
2148+ return '' ;
2149+ }
21472150 if ( active . length === 1 ) {
2148- // One dimension
2149- return ' %FILTER ' + this . getFilterString ( active [ 0 ] )
2150- } else {
2151- const strings = active . map ( flt => this . getFilterString ( flt ) ) ;
2152- return ' %FILTER NONEMPTYCROSSJOIN(' + strings . join ( ',' ) + ')' ;
2151+ return ' %FILTER ' + this . getFilterString ( active [ 0 ] ) ;
2152+ }
2153+
2154+ // Nested NONEMPTYCROSSJOIN for any number of filters > 1
2155+ const strings = active . map ( flt => this . getFilterString ( flt ) ) ;
2156+ let crossjoin = strings [ 0 ] ;
2157+ for ( let i = 1 ; i < strings . length ; i ++ ) {
2158+ crossjoin = `NONEMPTYCROSSJOIN(${ crossjoin } ,${ strings [ i ] } )` ;
21532159 }
2160+ return ' %FILTER ' + crossjoin ;
21542161 }
21552162}
You can’t perform that action at this time.
0 commit comments