Id can’t seem to figure out how to remove rows with no data within a “Cross Tab” table.
In Reporting, in the “Outline” panel, I first loaded in a query into my data sets. I then created a “Data Cube” to import this data query. I added a “Cross Tab” to the report and dropped the “Data Cube” in the “Cross Tab”.
The table gets populated, with rangers as the rows, and the number of patrols/distance patrolled, etc. as the columns. However, there are a lot of rangers that do not have any patrols and I’d like to remove these empty rows (see example image from report).
How can I format the Cross Tab so that it only populates rows with data?
I did notice that in the properties there is a “Empty Rows/Columns” menu, but I can’t seem to figure out how to enable it. Please see the attached image.
It works fine when there are two branches. But when we only have one, I’d like to hide the rows for “Volumen 2 (l)”, “Tiempo promedio 2 (s)”, and “Caudal 2 (l/s)”. I’m a bit confused about how to apply a computed column or filter to make that happen.
be careful with your script, try use another data to check your script.
In JavaScript, the expression !row["Tiempo promedio 2"] is using the logical NOT operator (!) to evaluate the truthiness of the value found at the key "Tiempo promedio 2" in the row object.
Here’s a breakdown of what this means:
Accessing the Property: row["Tiempo promedio 2"] accesses the value associated with the key "Tiempo promedio 2" in the row object. This is a way to retrieve a property value using bracket notation.
Logical NOT Operator: The ! operator negates the truthiness of the value. In JavaScript, values are considered “truthy” or “falsy”. The following values are considered “falsy”:
false
0
"" (empty string)
null
undefined
NaN
If the value of row["Tiempo promedio 2"] is any of these falsy values, !row["Tiempo promedio 2"] will evaluate to true. If it is a truthy value (any value that is not falsy), the expression will evaluate to false.
In summary, !row["Tiempo promedio 2"] checks if the value of "Tiempo promedio 2" in the row object is falsy and returns true if it is, or false if it is not.
I would like to set a condition to erase the whole grid if there is no data for this section, but i’m not sure which one is the best approach since the grid seems to not recognized the elements of the tables.