How can I get the minimum value of multiple columns in contour? - palantir-foundry

Context: I have a dataset with multiple numeric columns, which I am analysing in Contour. During one step of my analysis I want to find the minimum value of three different columns for every row.
Question: Is there an expression function in Contour I can use to get the minimum or maximum value of two or more columns?

Generally speaking you can find all available expression functions in the Foundry Contour documentation under the References section.
For this specific case the following two functions can be used:
GREATEST: Returns the maximum value of the list of values/columns. Null values are ignored.
LEAST: Returns the minimum value of the list of values/columns. Null values are ignored.
The usage would look as follows:
greatest("numeric_column_1", "numeric_column_2", "numeric_column_3")

Related

Two Way table in knime?

I am new to KNIME and I have a question, I have column splitter node that is outputting one column and one row. This will naturally have one value in the cell. I want to feed this value into a column of a table in KNIME. How do I do this?
I Don't see two way tables in KNIME.
You can use the Cross Joiner node to append the constant column. (There is also the Table Row to Variable and Constant Value Column combination if the constant value is one of the primitive types (String, Double, Int).)
You may need the RowID node to replace/restore the row ids.

Display character in table cell based on calculation results in another cell

I have a table in SSRS 2008R2 that calculates a percent value for two numbers, and places an asterisk (*) in the last column if the percent value is below .65. This works fine in the individual rows. However, I have to calculate the percent value for totals rows as the table is rendered (1st row, Percent column). I need to use this value to determine whether the asterisk in the '<65%' column will show. Can this be done, or do I need to go back into the code and derive the value there?
The answer to your question depends on whether the calculated cells are inside the scope of the group on which you are aggregating. If they are inside the group scope, it is possible to derive these values in SSRS. If not, they have to be pre-calculated in the underlying dataset. This is because referencing of cells cannot be determined when a source cell's position relative to the derived cell is dynamically generated.

add variable number of empty columns to a tablix

I have a tablix with a column group so that it will create a column for that field provided any row has data for that column.
I need to create a version of this report that contains some empty columns on the end.
I want the number of columns to be added to be based on some factor of the non empty columns with some min/max constraints also. (my question is not how to get the number of columns required)
so far i've tried.
1 - adding individual empty columns to the tablix and setting the visibility condition on each column.
a bit long winded and a bit of a faff.
2 - creating another column group and grouping on the same field, this creates
cant vary the number of columns returned.
am i missing a simple way of adding x empty rows or columns to a tablix? where x can be calculated somehow from the values in the dataset.
You will have to fib this scenario in your data. The column-wise grouping works with known data including those falling in the column group value with null values. There is no way to grow your groups without data unless you add some column group footer logic that would be pretty weird.
I would look into producing phantom NULL value records that will push out your columns.

Fuzzy lookup in SSIS does not output the result expected

To make things simple lets say I have a Client table with Fields:
ClientID
PCode
Region
I have a look up Region table with Fields:
ID
PostCode
Region
The Client table has one row :
123, 3075, THOMASTOWN
The Region has 2 rows:
1,3074,THOMASTOWN
2,3075,LALOR
I am trying to cleanse some data using SSIS fuzzy lookup.
I use the Client as source and the lookup as Reference. When the Max number of matches to output per lookup is 1 the result is 123,3075,THOMASTOWN, 1,3074,THOMASTOWN. In this case SSIS prefers the value of region over the value of pcode. But when I increase this option to a higher (2, 4, or 100) all the result rows are the same as the previous one.
I expect when I increase the number the other row of the lookup table shows up as one of the matches because the row has the same region code as the Client row.
To my surprise when for the first time I increased the option from 2 to 4 I saw the expected result (the other lookup record as a match) in 2 out of 4 rows of the fuzzy lookup output but since then it has never happened again and I always see the exactly same records as per different values of Max number of matches option.
Can anyone explain to me what's happening here and if I am doing something wrong?
From BOL: http://msdn.microsoft.com/en-us/library/ms137786.aspx
The transformation returns zero or more matches up to the number of matches specified.
Specifying a maximum number of matches does not guarantee that the transformation
returns the maximum number of matches; it only guarantees that the transformation
returns at most that number of matches.
If you are using these two columns in your matching, the region seems to be different enough that the pcode is still not a strong enough match on its own to return any results.
There are a couple of options:
Try tuning the similarity threshold and see if you can get the row returned
Use two fuzzy lookups (one for each column), so that if the first does not match or the similarity % is not strong enough, you can perform a second lookup to make the match.

Divide Fields by Sum to get Percentage SSRS

I wanted to figure out a way to get the percentage by using the data divided by the sum of the overall data.
For example:
[NumberofClients]/[Sum(NumberofClients)]
For each row it should have a different percentage based on the number of clients.
However, when I execute the expression above I always get 100%.
When you're apply the Sum, it will be calculated in the current Scope - if this expression is in a Details row, it will only ever be looking at one row, which explains why it's always 100%.
You need to use a Scope parameter to get more than the current row in the Sum, something like:
=Fields!NumberofClients.Value / Sum(Fields!NumberofClients.Value, "MyDataset")
Which is giving the % value for the particular row compared to all the rows in the Dataset, which seems to be what you're after.
You can change the Scope parameter to be a group instead of the whole Dataset as required.