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 @@ -2126,18 +2126,25 @@ export class BaseWidget implements OnInit, OnDestroy {
2126
2126
private applyFilters ( filters : IFilter [ ] ) {
2127
2127
const active = filters . filter ( flt => {
2128
2128
// Skip all apply variable filters
2129
- if ( flt . action === 'applyVariable' ) {
2129
+ if ( flt . action === 'applyVariable' ) {
2130
2130
return false ;
2131
2131
}
2132
2132
return flt . value !== '' ; // && !flt.isInterval
2133
2133
} ) ;
2134
2134
2135
+ if ( active . length === 0 ) {
2136
+ return '' ;
2137
+ }
2135
2138
if ( active . length === 1 ) {
2136
- // One dimension
2137
- return ' %FILTER ' + this . getFilterString ( active [ 0 ] )
2138
- } else {
2139
- const strings = active . map ( flt => this . getFilterString ( flt ) ) ;
2140
- return ' %FILTER NONEMPTYCROSSJOIN(' + strings . join ( ',' ) + ')' ;
2139
+ return ' %FILTER ' + this . getFilterString ( active [ 0 ] ) ;
2140
+ }
2141
+
2142
+ // Nested NONEMPTYCROSSJOIN for any number of filters > 1
2143
+ const strings = active . map ( flt => this . getFilterString ( flt ) ) ;
2144
+ let crossjoin = strings [ 0 ] ;
2145
+ for ( let i = 1 ; i < strings . length ; i ++ ) {
2146
+ crossjoin = `NONEMPTYCROSSJOIN(${ crossjoin } ,${ strings [ i ] } )` ;
2141
2147
}
2148
+ return ' %FILTER ' + crossjoin ;
2142
2149
}
2143
2150
}
You can’t perform that action at this time.
0 commit comments