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 {
2138
2138
private applyFilters ( filters : IFilter [ ] ) {
2139
2139
const active = filters . filter ( flt => {
2140
2140
// Skip all apply variable filters
2141
- if ( flt . action === 'applyVariable' ) {
2141
+ if ( flt . action === 'applyVariable' ) {
2142
2142
return false ;
2143
2143
}
2144
2144
return flt . value !== '' ; // && !flt.isInterval
2145
2145
} ) ;
2146
2146
2147
+ if ( active . length === 0 ) {
2148
+ return '' ;
2149
+ }
2147
2150
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 ] } )` ;
2153
2159
}
2160
+ return ' %FILTER ' + crossjoin ;
2154
2161
}
2155
2162
}
You can’t perform that action at this time.
0 commit comments