SPOTFIRE: Get a specific value from the table based on a column - spotfire

I'm new to spotfire and used to work with PowerBI. It's very easy to do that there, but on spotfire I'm having difficulties
Get a specific value from the table based on a column
I need to show which process name is most delayed in the database and show it in a txt area
I have a column that shows how many hours this process took, I wanted to get the name of this process based on the value of this column hours
Example: return a value from the table where the hours column is the largest among all
My idea is to take this value and show at a txt area

Related

Create calculated column in one table using data from another table in Spotfire?

Apologies for asking this, I see a few similar questions but unfortunately I don't really understand the answers given. I am fairly new to Spotfire.
I am trying to create a calculated column in one table based off of data from another table. The first table (which I am trying to add the new column to) is a monthly data census of all contracts the company has. Each contract has one row. Call it "monthly table". The second table is a complete transaction history for all contracts, so each contract can have hundreds of rows. Call it "total table".
I am not sure if I can link the data tables. I read in a few similar questions to insert columns from the table with data into the table where the new column will go, or to merge them beforehand, but the monthly table has about 13,000 rows compared to the total table's 550,000, so I am not sure how this would work.
I am trying to create a column to sum all the transaction amounts for each contract if the transaction type (also in the total table) is equal to a certain string. Like a "net transactions to date" column. I successfully created this column in the total table, but then each cell for a contract that meets the conditions had the transaction sum. I want it in the monthly table, where each contract just has one row, and it only displays the sum once. This is the code I have:
IF(
Concatenate([Contract_Number],"(transaction type string)",[Month],Year([Date]))
=[Type],
Sum([Amount]),
NULL)
It is currently in the total table. If possible I would like it in the monthly table, and for the [Number] and [Date] columns to refer to the monthly table, and [Type] and [Amount] to the total table.
Sorry if this is too much information or confusing! Also I know there is a problem with my summation (it is summing all transactions and only displaying in the correct rows, but it needs to only sum correct rows), but I think I can figure that one out, I just need help getting it in the right table.
I am currently working on transitioning a process/workbook from Excel to Spotfire.
If it would help I can provide the current formula used for this process in Excel.
After a few more hours of tinkering, I figured it out! I thought I would explain what I did here in case anyone else encounters a similar conundrum.
TLDR; Made the desired column in the total table, and added the new column to the monthly table with a left single join on the contract number.
My month and date are tied to a document property which is a drop-down of unique date values in my monthly table. Within the total table, I used a similar code to what I've typed above, but instead of referencing the Date column directly, I referenced the document property, so it was pulling the date from the monthly table into the total table. I also switched from the form IF(condition, SUM()) to SUM(IF()) OVER (). This ultimately summed the correct values. For example, there might be five different types of transactions for each contract, but I only wanted the sum of two types. This resulted in the correct sum being displayed. The sum was displayed in every single cell corresponding to the correct contract number in the new column, so (in the same example) in all 5 contract #1 rows, the sum of the two correct types was displayed.
Then, I went to the data canvas for my monthly table, and added the new column. I chose a left single join, as each contract had only one row in the new table, so that the correct sum would only be displayed once.
End result code:
SUM(IF(Concatenate([Contract_Number],"type-string",[Month_ValDt],[Year_ValDt]) =
[Type], [Amount],0)) OVER ([Contract_Number])
Where [Month_ValDt] and [Year_ValDt] are new columns I made in the total table that display the month and ye
ar from the document property that is tied to the date in the monthly table.
Reasoning for the property is that we have a few years of data but I was told to make it dynamic so only one month of data is visible at a time, hence the drop-down.

Excel "SMALL" "IF" another row is not blank

I try not to ask for help like this but this one is screwing my noodle.
I have a costing spread sheet that I have managed to manipulate to give me a monthly cost role up (if exists) VS part number. Part numbers column c, months row 3.
On another sheet I'm trying to list the part numbers next to the cost role up and relevant date (each part number may have multiple entries)
I just need to do a "SMALL" for the "date" row (Row 3) on my costing sheet "IF" the "correct part number row" (or a fresh MATCH/VLOOKUP for the part number) has data in it. Or some how have the small return the Column INDEX number. I could then use INDEX to return the correct date and value using SMALL and Column B (the number of costs per part number, so if there are 3 instances that column currently list 1,2,3 before starting the next part number)
So close..... but this last bit is a struggle. Its a shame SMALL cant return INDEX Column numbers.
Does anyone know how to get a "SMALL" to lookup a row (based on a column search criteria) and check if the column has data, if so include the that column header in the "SMALL"
Update...
Thanks for your comments. I've stripped out the problem into a separate sheet to make it a little clearer. (I'll upload if possible).
I've also completed the rest of the excel to show the whole process. In doing so I've discovered Headers are automatically converted to text and so added a column to work around this using "DATEVALUE".
The goal is to list the number of costs related to a part number so.... if 500111 has had a cost role up in 3 different months it will list them in the cost report. So.... part number, relevant column "date" from "Cost data" sheet and relevant cost (#that part number # that date). if I can get a list of dates from "Cost Data" columns and put them in Column D "Costing date (text)" next to the relevant part number i should be sorted. I've highlighted the column in red on the new screen shots.
Cost Report
Cost Data
lines highlighted in yellow just to show they are empty
Edit:
Almost there for anyone else trying this
=INDEX($B$5:$J$5,,SMALL(IF($B$6:$J$6>0,COLUMN($B$6:$J$6)),3))
I just need to figure out how to define a variable "ROW" within a SMALL(IF statement. I should then be able to reference the correct table row number (which I already have).
Anyone know how to put a variable ROW or COLUMN reference in a SMALL formula?
Did not understand the problem fully.
But like this you can have a variable Row in the small formula:
=SMALL($A$4:$A$10;ROWS($C$4:C4))

IF there is an overlap with a date range, return value from row with overlap

I am attempting to return a value a specific value in excel if there is a date overlap between two different rows. There is a requirement that another cell matches, this would be an ID but only return the value for a second ID also listed.
I have a report where column 1 is the name ID, column 2 is the project id and column 3 and 4 are the start and end dates.
If there is an overlap of dates based on name ID, I want excel to return the project id from column 2 of the row that is committing the overlap.
Example of desired outcome
I'm not sure there's an easy way to do this in Excel*, but it would be fairly straightforward in SQL - is that an option? If it is, you need an ID column - just a simple incremented integer.
Also, you need to specify what happens if there is more than one other overlapping entry.
unless you like writing complex functions and/or navigating Excel's rather tortuous SQL option.

In excel, from a range of rows, return the column value of the row with the highest value from another column

I apologize if the question sounds vague, but let me explain. I have a spreadsheet with 20 rows that each consist of a column for employee name, ID, Calls taken MTD, calls dropped MTD, and satisfaction rate respectively. I'm trying to create separate cells which will list the top 3 employees with the highest satisfaction rate. Since this spreadsheet is updated daily, I'm trying to create a formula which will list the top three for me as opposed to manually typing each time.
So basically instead of returning the cell containing the second highest value of satisfaction rate (which I did with =LARGE()), I am trying to return the name of the employee corresponding to that cell. That is where I am stuck. Any help would be appreciated. I'm just trying to do this in Excel only, not with VBA.
You can do that with LARGE, INDEX, AND MATCH (assuming you don't have two employees with the same rate)
=index(employees,match(satisfaction_rate,satisfaction_rates,0))
i.e.
=index(employees,match(large(satisfaction_rates,2),satisfaction_rates,0))

get the average of two columns in views using lotus notes formula

How to get the average of two columns in views using lotus notes formula
Create a new column in your view to display the average. You'll add a formula to this column to calculate the average.
If the two columns you wish to average are simply based on items in your documents, then add this formula:
(Column1 + Column2) / 2
If your columns are more complex, for example they contain calculations themselves, then you'll want to refer to the column using its programmatic value. On each column, right-click on the column and then click "Column Properties". Select the last tab and set the Programmatic name to some text, for instance Calc1 and Calc2. Then use this formula in your third column:
(Calc1 + Calc2) / 2
If you want to display the average of 2 columns then Bluefoot's comment referring to another question is what you require. However, if you also want to display the result in a subsequent third column, then you have a bit more of a problem.
You will need to write a scheduled agent that takes the average but then writes the result into a field on to the document, and then use that field as the value to be displayed in the 3rd column. I say a scheduled agent as you could have this run hourly or daily as required to update values. If a user changes the values that would cause a re-calc. You can clear the new field pending update of by the scheduled agent. There are still other ways to do this, depends on requirements.

Resources