Get Free Trial

Using showEmptyValues in flat view

Resolved
Jimmy asked on August 30, 2021

Hello,
 
Is it possible the use showEmptyValues in the flat view as to only show data where there is a value in the measure.
 
/Jimmy

7 answers

Public
Vera Didenko Vera Didenko Flexmonster August 30, 2021

Hello, Jimmy,
 
Thank you for your question.
 
Currently, showEmptyValues is intended for compact/classic layouts.
Still, it is possible to filter out empty values by applying the corresponding filter (see Filter Object format).
For example, the following will only show rows where the measure "Discount" is not empty:

{
uniqueName: "Discount",
filter: {
exclude: [
"discount.[]"
]
}
}

Here is a JSFiddle for illustration: https://jsfiddle.net/flexmonster/efLwkb6s/.
You can also apply filters programmatically with the setFilter() API call.
 
Please let us know if this helps.
 
Kind regards,
Vera

Public
Jimmy August 31, 2021

Hello Vera,
Thanks this seem to work if the measure is a “number”.
 
But if the measure is a “string”, “date”, “time”, “datetime” it doesn’t seem to be working.
 
/Jimmy

Public
Vera Didenko Vera Didenko Flexmonster August 31, 2021

Hello, Jimmy,
 
Thank you for your reply.
 
To filter out empty values in a flat layout, you need to filter each field containing empty values.
Here is a JSFiddle for illustration: https://jsfiddle.net/flexmonster/182vLnso/. In the example, we used different data types such as "date string", "time", "string", and "number".
 
Please let us know if this helps.
 
Kind regards,
Vera

Public
Jimmy September 1, 2021

Hello Vera,
 
Given the following: https://jsfiddle.net/74kuz0sv/
Where “AccountDescription” is a measure the exclude filter is not working.
 
Also if you have multiple measures and only want to exclude if all measures is empty is this possible using the filter in flat view?
 
/jimmy

Public
Vera Didenko Vera Didenko Flexmonster September 2, 2021

Hello, Jimmy,
 
Thank you for providing a code sample.
 
We noticed that "AccountDescription" doesn’t contain any values – they are all empty.
In this case, the exclude filter won’t work. 
 
In case you would like to display only the rows where all columns contain values, this is possible by applying a query filter.
For example:

"filter": {
"query": {
"not_equal": "(blank)"
}
}

This will result in an empty grid if there are only empty values in the filtered field.
 
If you are looking for a way to hide empty columns, the best way is to exclude them from the slice. This can be done via Flexmonster’s UI through the Field List.
 
We hope this helps!
Feel free to reach out should other questions arise.
 
Kind regards,
Vera

Public
Jimmy September 8, 2021

Hello Vera,
 
In the following jsfiddle I would expect to be shown 12 out of 16 records as AccountDescription or Actual is not null in them. can this be acomblished: https://jsfiddle.net/c1vzmj07/
 
/Jimmy

Public
Vera Didenko Vera Didenko Flexmonster September 8, 2021

Hello, Jimmy,
 
Thank you for your question.
 
Currently, Flexmonster’s UI doesn’t support “or” filters.
For such cases, we suggest filtering the data outside of Flexmonster, for example, on your server.
 
Should other questions arise, feel free to reach out.
 
Kind regards,
Vera

Please login or Register to Submit Answer