Spotfire: How to use trellis to show 4 elements: 3 years + set of records older than 3 years? - spotfire

Lets say I have the data about some kind of requests.
I have column determining request's creation date.
I wish to show the requestes Trellis'ed by this date but not the standard way.
I wish all the requests with creation date older than 2013-01-01 to be grouppped in one trellis graph.
I also would like to retain the possibility to have information on both year and quarter level as it is available for typical date column.
The image below show sth similar to what I need but the Empty section comes as the last one and I need it with different label and on the left hand side rather than as it is now on the right hand side.
Any ideas ?

my suggestion is to make two visualizations. you can duplicate the one you've already created and then limit its data by editing the properties for that vis, viewing the Data page, and using the Limit data using expression field, giving an expression like [Date Column] < "2013-01-01". you'd do the same on the second vis except use an expression like [Date Column] >= "2013-01-01".
the easiest way to change (Empty) to "something" is to not leave it empty :) you can create a calculated column with the expression If([Column] is null, "Custom Empty", [Column]) and then use that on the horizontal axis. alternatively you can hide (Empty) values from a visualization by limiting the visualization by an expression like [Column] is not null.
you can adjust the order which values are shown by going to the Edit menu and choosing Column Properties. choose the column, click the Sort Order tab, select Custom Sort Order, and click Configure.

Related

Aligning vertically a series of tables with text

Hi I need the text to be in a specific format in a spreadsheet to be able to upload it on a translation tool.
I have already used the text split function to separate the text in a cell with bullet points, moving each bullet point to a separate cell.
enter image description here
Then I used the transpose function to separate each set of data. For context, you are looking at fashion products.
The name of the product is on the first row, followed by a list of features (e.g. "Bracciale" means bracelet and it is followed by the list of materials)
enter image description here
Now for the last step, I need these sets to be vertical, not horizontal. Like this:
enter image description here
I would like to set up an automatic system so that every time we receive a list with hundreds of these products we do not need to copy-paste them one below the other.
With pivot tables maybe? Keep in mind that if it is too complex it might be hard to train the translators to do it each time. Please let me know your suggestions. Thank you!
I am not a programmer. I tried pivot tables but the data was in the wrong order and I am not sure how to get the data out from the pivot table with values only without the sub-menus.
My suggestion would be to use the 'Unpivot Columns' feature in the Power Query Editor - it would be really simple.
Steps:
Select the whole range
Go to Data // Get & Transform Data // From Table/Range
Uncheck 'My Table has headers' (unless it does - but doesn't look like it?)
Press OK. This will open Power Query Editor and will have actually given you column names Col1/2/3 etc, but ignore that.
Go to Add Column // Index column
Select all columns EXCEPT the new index column by Shift+clicking on those headers
Go to Transform // Unpivot Columns
Assuming the order is important, click in the Attribute column and Sort Ascending
Click in the Index column and Sort Ascending
Remove the Attribute and Index columns if you want (right click header)
Go to File // Close & Load
You will get a new table - dynamically linked to the first (ie. can be updated/refreshed) - in the unpivoted format.
Let me know if you need more details / screenshot?
Based of this trick, maybe the following is helpfull:
Formula in A5:
=DROP(REDUCE(0,A1:A3,LAMBDA(a,b,VSTACK(a,TEXTSPLIT(b,,HSTACK(CHAR(10),"^"),1)))),1)
TEXTSPLIT() will use a combination of newline chars and the circumflex to split the input directly into a vertical array;
Iteration in REDUCE() will allow for stacked results;
DROP() the initial value from results.

Column to rows and highlight difference between values in the same group

I have a huge table with data structured like this:
And I would like to display them in Spotfire Analyst 7.11 as follows:
Basically I need to display the columns that contain "ANTE" below the others in order to make a comparison. Values that have variations for the same ID must be highlighted.
I also have the fields "START_DATE_ANTE" and "END_DATE_ANTE" which have been omitted in the example image.
Amusingly, if you were limited to just what the title asks, this would be a very simple answer.
If you wanted this in a table where the rows are displayed as usual, and the cells are highlighted, you can do this by going to properties, adding a newGrouping where you select VAL_1 and VAL_1_ANTE and add a Rule, Rule type "Boolean expression", where the value is:
[VAL_1] - [VAL_1_ANTE] <> 0
This will highlight the affected cells, which you can place next to each other. You can even throw in a calculated column showing the difference between the two columns, and slap it on right next to it. This gives you the further option to filter down to only showing rows with discrepancies, or sorting by these values.
However, if you actually need it to display the POSTs on different lines from the ANTEs, as formatted above, things get a little tricky.
My personal preference would be to pivot (split/union/etc) the data before pulling it in to Spotfire, with an indicator flag on "is this different", yes/no. However, I know a lot of Spotfire users either aren't using a database or don't have leeway to perform the SQL themselves.
In fact, if you try to do it in Spotfire using custom expressions alone, it becomes so tricky, I'm not sure how to answer it right off. I'm inclined to think you should be able to do it in a cross table, using Subsets, but I haven't figured out a way to identify which subset you're in while inside the custom expressions.
Other options include generating a table using IronPython, if you're up to that.

Spotfire: editing the headers of a cross table

I've built a cross table in Spotfire with some data which is aggregated in various ways (e.g. "sum", "first", etc.).
The default headers are really ugly (e.g. "SUM(revenue)") and I would like to change them to something a bit more relatable. For example, instead of SUM(revenue), I would like to have "Total Revenue".
Just edit the properties of the Cross Table (right click, properties), then type a new name into the Display Name box that I helpfully outlined with a freehand red circle! You get to that screen by clicking the little black triangle beside the column name:
For the example you gave in your question, just add the bolded portion below in the Custom Expression editor:
Sum(Revenue) AS [Total Revenue]
With several columns, it would be:
Sum(Revenue) AS [Total Revenue], Sum(Expense) AS [Total Expense]
...and so on. You can also include special characters in your title as long as you're using the brackets
OK, I think I found a way...apparently you can't change the columns that are already there but you can delete everything and set the names when you are setting up the columns.
Full details here:
http://docs.spotfire.cloud.tibco.com/spotfire/GUID-796A4E7B-6669-4F39-8746-5B73F44F342B.html
If anyone knows how to edit the titles instead of having to re-do the table every time, it would be great!

Macro to sort Alphabatical + Numbers with special cases

I have a hard time sorting something out, I need for my workspace.
TBK1872(2)
TKP1880
TKP1898(2)+1
TKP190
TKP1911
TKP2006-1
TKP2103(2)
TKP2195(2)+1
TKP310(2)
TKP32
TKP32+1
TKQ1267
TKQ13
TKQ138(2)
These are signatures I need to order in a specific way.
First of all, these signatures should be ordered, that they are in an alphabetic order.
There are those cases, where it can happen that there are four letters instead of three.
Those should come after the three letters
Example : TQL then after that the for letters like TQLA then TQLB and so on...
Then the numbers should be sorted after how short they are so 2 numbers then three numbers then for numbers not like the normal sort of:
TKP310(2)
TKP32
TKP32+1
TKQ1267
TKQ13
where numbers are sorted on high of the second number.
After that there are those special cases where an (2) or +1 or a combination of both is happening.
These should be sorted after the number in the brackets and then after the +1 count beginning from 1
Is it anyway possible writing an sorting algorithm for that?
Could someone help me ?
I would really appreciate it.
You can use a complicated custom sort order to sort in an odd (or "special") order, by importing a list of all the values in the order that you want it.
If the list only contains a few items, it's probably quicker to enter the list into the custom sort dialog manually.
Sort data using a custom list
With built-in custom lists, you can sort data —either by days of the week or months of the year. Optionally, you can create your own custom lists to sort by any other characteristic that doesn’t sort well alphabetically—such as high, medium, and low—or S, M, L, XL.
For example, with custom lists you could sort this worksheet by delivery (month) or by priority.
For example, to sort by days of the week or months of the year with a built-in custom list, you do the following:
Select the columns you want to sort.
For the best results, each column should have headings.
On the ribbon, Click Data > Sort:
In the Sort dialog box, in the Sort by box, select the column you want to sort by:
From the Order dropdown, select Custom List:
In the Custom Lists tab, select the list you want, and then click OK to sort the worksheet:
Create your own custom list
In a column of a worksheet, enter the values to sort by. Arrange them in the order that you want to define the sort order—from top to bottom. For example:
Select the cells in that list column, and then click File > Options > Advanced.
Under General, click Edit Custom Lists.
In the Custom Lists box, click Import:
Further examples, information and resources can be found at the source.

Crystal Reports - my formula works, but when repeated in more than 1 subreport, all records disappear

I'm not a developer but I'm supposed to create a report by C.R., so excuse me in advance if it is an obvious question for you, and please keep in mind that I'm a real beginner.
I have a job composed of 3 different workings (3 out of 5, which is the maximum workings I can have for a job).
In my SQL database, the table.field corresponding to those workings is job.phase, so when I put, in my report details, the field "job.phase", I get 3 rows for that job.
The point is that my report printout always has to show 5 different text objects (one below the other), corresponding to the descriptions of all the 5 possible table.field-records, and a 'X' should appear next to text objects when each one of the workings listed there is a part of my job (otherwise nothing should appear).
What I have done is the following:
- created a subreport containing the "job.phase" field
- put it near my first text object
- specified in my subreport the following "show string" formula:
if job.phase = 'working1' then 'X' else ''
and it works: a X appears if working1 is part of my job, nothing appears if working1 is not part of my job.
Then I have created 4 subreports more, equal to the first one, and specified the same for job.phase = working2, working3, working4 and working5, BUT, after doing that, no X is shown (even though working 1, 2 and 3 are part of my job)...
Is there anybody who can help me, please? It's so frustrating...
Using subreports for something like this is overkill for what you're trying to do and could be causing any number of things to behave badly. I'd recommend you abandon that idea. Here's how I would do it:
The first thing you'll want to do is group by job (if more than one will appear in your report, which I'll assume it will). The Group Footer section is where you can display the labels and Xs. You'll need to create 5 formulas as you did before if {job.phase} = "working1" then "X", one for each of the phases/workings. Drop all 5 of those formulas into the Details section of the report and then suppress that entire section so that it doesn't display.
To show the Xs, you can use a Maximum summary in the Group Footer for each of the five formulas you created. To do this, right-click each of the formulas in turn, select Insert -> Summary. Choose Maximum as the summary, and "Group 1" (Your job ID or whatever field you are using to group the job) as the Location. That will insert a field into the Group Footer that will display an X when that particular working is specified for the job, otherwise it won't display anything. Move them to display next to the appropriate label/text field and you're done.

Resources