Make Spotfire ignore empty values in the categories of charts and show a visualization without "spaces" between the bars - data-visualization

I have a group of trellis graphs on some data, in there you can see a numeric variable on the Y axis and a series of cell dishes on the X axis. Not all the numeric values are present on all the series of cells. Because of this the visualization results in a graph with empty spaces:
This is OK most of the time but the thing is I would like to avoid the "empty spaces, only in these graph series, that you can see between the bars. I would like to see showing only the pattern of the cell dishes where I have data.
Trying to do so I tried creating a calculated column to use it as a ordering index (https://docs.tibco.com/pub/sfire-bauthor/7.9.0/doc/html/en-US/GUID-8CAA18D0-CF28-4707-9945-041BDFD99E99.html) (Sorting Filter values asc/desc on Tibco Spotfire), after that "Limit data by expression" using a "[MyColumn] is not null" on it (https://community.tibco.com/questions/can-i-automatically-make-spotfire-ignore-empty-values-categories-charts) (How to show the top 10 column values in Spotfire) with no luck and I tried also (https://docs.tibco.com/pub/spotfire/6.5.1/doc/html/ncfe/ncfe_details_on_custom_expression.htm) create a custom expression, which I think it would be a good solution because I understand it will only affect these graphs and not the complete set of visualizations but no, I don't reach the point to change it. Last that it should work but it doesn't is to "Show/Hide Items" under a Boolean expression that it would include that "[Axis.Value] is not NULL" and "Apply individually for each trellis panel" of the numeric column which sound terrific but... nope, it didn't work either...
Any help would be appreciated, now I will select one by one on individual graphs extracting them and plotting them in other place but this is not very useful as a "large scale" solution. I am sure there is a way to insert a proper expression to avoid the null values of the cross of both variables, the numeric and the cell dishes.

this is because you are trellising data, not the axis. you won't be able to filter out values on the x axis; it's simply not how trellis works.
using multiple visualizations is the solution, but I assume you've got n sets of categories that you want to separate out without creating a ton of charts on the page and perhaps you can't guarantee the number of categories or their names, so you want to build a flexible solution.
please check out an answer I just wrote over here which illustrates how to use a document property and a property control to limit a visualization. your property control can be linked to automatically and dynamically display unique values in your "category" column (the one you are trellising by). maybe this can be a solution for you?

Related

OpenRefine columnwise scripting

I spent some time Googling, but couldn't find anything useful.
How to select all the values of a single column in OpenRefine in a script?
It seems that all the operations are row-wise
In particular, I want to find highest and lowest values in a column
By default, OpenRefine functionality are limited for computation. The Stats Extension make basic stats per column (min, max, average, medium ...).
Facets will give you a list of all the values in a column - so the simplest way of getting the lowest/highest values in the column is to make a facet on the column and see the resulting highest/lowest in the facet to get the answer.
However I'm not sure if this meets your criteria for selecting the values 'in a script'. By this I assume you mean you want to be able to access the lowest/highest values in a GREL expression?
You can do this, but you have to force OpenRefine to treat all the rows in project as part of a single record. The easiest way to do this is usually to add a column at the start of the project which is empty except for the first cell which contains a value.
Once you've done this you can access all the values in a column by using syntax like:
row.record.cells["Column name"].value
See also my answer to OpenRefine - Fill between cells but not at the end of the list which uses the same technique
Further explanation:
Create a new column at the start of your project and put a single value in the very first cell in that column
Switch to Record mode
At this point you should have a single 'Record' in your project - e.g.
At this point using the syntax like row.record.cells["Column 1"].value gives you an array of all the values in "Column 1". You can then use GREL expressions to manipulate this - including sorting or comparing values.
A Text Facet has an nice undocumented option to gives you aggregated results in a column that you can just copy and paste.
Click on the "X choices" in the upper left corner of the Text Facet box.
This will bring up a separate dialog that contains the values along with the count of each value in that column.
(If your looking to just get ALL the values of a single column, then use Export -> Custom Tabular Exporter and then Select and Order Columns to Export by clicking on checkboxes, then click on Download tab to choose your export format and then click Download button.)

Need a simple search function to display most common value in a column. (with ambiguous choices)

I have a very large array of data with many columns that display different outputs for the values presented. I would like to add a row above the data that will display the most common occurring value or word below.
Generally I would like to have each top of the column (right under the column label in row 1) have the most common value below. I will then use this value for various data analysis functions!
Is this possible, and if so, how? Preferably this will not require VBA, but simply a short code in the cell.
One caveat: The exact values may vary, so there is no set list where I can say "it will be one of these."
Any ideas appreciated!
Try a series of =COUNTIF(A:A,"VALUE TO SEARCH") functions if you want to stay away from VBA.
Otherwise, the best method would be to iterate through each column via VBA. With this method, you can even count the "varying" values and return the count and/or the value itself.
http://www.excel-easy.com/examples/most-frequently-occurring-word.html
This is a single formula you would write at the top of each column. Does not require VBA. You can replace the set range to an entire column, such as (A:A) instead of (A1:A7).
If you mean an array as in a data type, it could work differently but it depends what you're trying to do.
With data from A3 through A16, in A2 enter:
=INDEX($A$3:$A$16,MODE(MATCH($A$3:$A$16,$A$3:$A$16,0)))
This will work for text as well as numbers. Adjust this to match the column size.

How to display filtered data rows as a tooltip in Tableau Public?

Noob here, I have a table with different entries (rows) per different (repeating) regions.
I'd like to be able to display the data rows filtered - matching that particular region thanks - so I get those particular fields related to each region as a tooltip on a map. (I know how to build the map)
Thank you
Just dragging the fields you want to Details or Tooltip is not doing the trick?
Putting a measure on a shelf (other than filter shelf) includes that field in the visualization query results -- i.e. applies the chosen aggregation function to yield an aggregate result value for each partition of the data (as specified by the unique combination of dimensions)
Putting a dimension on a shelf (other than the filter shelf) also includes that field in the query results, but since the dimensions define how data rows are partitioned, it can affect the level of detail of the query. You'll notice this often as suddenly getting many more marks in your visualization after you add a dimension to a shelf. If you are familiar with SQL, dimensions define the fields that follow the GROUP BY keyword.
EDIT
Thanks for the addition, #AlexBlakemore. I've never said dragging a dimension would not work, only that it wouldn't work as the OP wanted it to (basically the same as you're saying).
And though everything you said (above) is true, it's particularly not exact when it comes to maps. Yes, dragging a dimension will further partition the data, but it will not create additional marks on a map (unless it has also geographical properties). Rather, the tooltip will get the first occurrence of that dimension, and display data for that only. For instance, if you drag "Product" to details, and the possible values are "Bread", "Coffee" and "Milk", it will probably just show "Product: Bread", and the measures for "Bread" only. So yes, it will partition, but no, it won't create additional marks.
Back to OP problem. What I believe you want is a tool tip with all values of the dimension (in my poor example you'd like to see "Bread, Coffee, Milk"). Tableau does not have functions to aggregate strings yet, so it's hard to do so.
What I would suggest is to create a separate sheet, and just drag the dimensions and measures you want to rows. Then put it side by side with the map on a dashboard, and use the map as a filter. Then, when you click on a country/region/city, you'll see the data of that region on the other chart.
Refer to: http://kb.tableausoftware.com/articles/knowledgebase/creating-filter-actions-dashboards
or https://www.tableausoftware.com/learn/tutorials/on-demand/authoring-interactivity

Reporting Services - Two filters on the same chart Category Group?

I have sales data that I'd like to plot on my chart. However, at a specific point in time, we had a change taking place I'd like to ensure is clearly visible in the chart, preferably by dividing the sales data (which is stored in a single SQL Server column) into two different chunks, which would allow me to then treat them as different data series.
I used to solve this in Excel by storing the post-event data in a different column (by simply dragging them to a different column), and thus I was able to treat them as a different series (the blue and green line in the chart below. The red and orange line are pre-event and post-event averages):
I'd like to reproduce this effect in SSRS, but am not sure how to tackle it. I've tried using an approach where I added two category groups, both pointing to the date-time column, and applying filters to them (one <= the cutoff date, the other >=).
I then added my sales data twice, with the idea I could somehow connect them to the individual category groups, but that does not seem possible.
Has anyone tried anything like this before, or would have a different approach to achieve what I'm trying to get?
Thanks!
I managed to get this to work, and figured I'd share how to do it.
My dataset contains a field called DATEKEY, which stores the date in the format YYYYMMDD. It's possible to use this in an expression and evaluate the date for a specific row. In case the expression evaluates to true, we display the value. If not, we display a blank string.
In case we want to show the values prior to the date, the expression would be:
=IIF(Fields!DATEKEY.Value <= 20130601, Avg(Fields!My_NUMBER.Value), "")
The second series can then be made by reversing the symbol:
=IIF(Fields!DATEKEY.Value >= 20130601, Avg(Fields!My_NUMBER.Value), "")
The graph then looks like this:

Use columns.add(...) in Word with non-uniform column widths?

Problem I'm having is that table.Columns.add(ref Object BeforeColumn) requires a reference to another column in the table. However, when I try to access the last column in the table to pass as a reference using table.Columns.Add(table.Columns[table.Columns.Count])
I get the error:
"Cannot access individual columns in this collection because the table has mixed cell widths."
As my current work around, I catch the error, and call table.Columns.DistributeWidth() to make sure the columns are uniform and run the rest of the code. However, I lose the formatting of my cell widths this way, which is unfortunate.
Is there any way I can workaround this without losing the cell width?
(I realize one way is to store every cell's width before running this process, and then re-applying the widths afterward, but this seems like a very costly solution to something that should be simpler)
I've found one way to do it. Here's how I approached it.
*Caution, I'm assuming that the table is uniform. i.e. The number of columns is the same across all the rows. (Note, the API has a Table.uniform function, but the description is not complete. In the API it says "True if all the rows in a table have the same number of columns." However, it also checks if the columns have uniform width).
Instead of using table.Columns.Add(table.Columns[table.Columns.Count]) to add a column before the last below, I select a cell in the table and used the insert command:
//assuming table is the name of the table you want to add columns to
table.Cell(1, table.Columns.Count).Select();
word.Selection selection = table.Application.ActiveWindow.Selection;
selection.InsertColumns();
This might actually be a better way to add columns, as the api gives you way more options on how to insert (i.e. use InsertColumnsRight to insert to the right of the column). The Columns.Add(...) function by default inserts to the left of the select