Populate C with max value of B for each row of related values in A - max

Goal: Using Excel 2010, how can I get each change number's (listed in column A) to show the Max Business Criticality (from column B) to display in column C via formula(s)?
Let me explain: I have a list of Change tickets (in column A) where the change number will likely be listed multiple times (due to different locations and servers). This means each change number may be listed once or may be listed 20 times. Each occurrence of the change number is assigned a Business Criticality (again, based on different locations and servers). This value is captured in column B.
In column C, of the same table, I need to return the max criticality associated with each change and have that be displayed in each row (see image for desired result - colored for ease of differentiating change numbers).
Everything I've seen involves creating a distinct list of change numbers separate from the source table. I'd rather not do that.
How can I get each change number's MaxCrit to display in column C?
I'll try to attach the file if I can figure out how (and/or if I have rights to do so).

In C2 with Ctrl+Shift+Enter and copied down to suit:
=MAX(IF(A:A=A2,B:B))
with

Related

Google Sheets - Removing the used items from drop-down lists

In Google Sheets I have a column containing a list of available Serial Numbers (say, column A).
Somewhere else (say, column B) a user must choose the serial number used among those listed in column A; I use Data Validation with a drop-down list in order to prevent the user to use a non-existent serial number.
My goal is to allow the user only choose the remaining available serial numbers, by removing from the drop-down list all the serial numbers already used.
By using the FILTER function, combined with MATCH and ISNA, I am able to create a column of available serial numbers (say, column C). The function used is:
=FILTER(A2:A;ISNA(MATCH(A2:A;B2:B;0))).
Then I moved the Data Validation list of column B (where the user must select the serial number used) from column A (all serial numbers) to column C (filtered serial numbers). I also added the "Reject input" in the Data Validation form, so I can allow the user only to enter a value listed in column C.
It works, but all the previously entered serial numbers on column B have a small red triangle showing that data is not valid. Of course, this happens because all entered values are removed from the data validation list.
I could simply ignore the red triangles, but I don't like this solution that much, because it always looks like there's an error on the sheet, and when we will have many data inside it would be difficult to distinguish this problem from any others.
Is there a different way to solve?
Thanks
with formula only you can use:
=TRANSPOSE(FILTER(A2:A, NOT(COUNTIF(C3:C4, A2:A)), A2:A<>""))
=TRANSPOSE(FILTER(A2:A, NOT(COUNTIF({C2; C4}, A2:A)), A2:A<>""))
=TRANSPOSE(FILTER(A2:A, NOT(COUNTIF(C2:C3, A2:A)), A2:A<>""))
then hide columns and use validation:
where this is the result:
demo sheet
update:
1st fx:
=TRANSPOSE(FILTER(A2:A, NOT(COUNTIF(C3:C4, A2:A)), A2:A<>""))
2nd and every next fx:
=TRANSPOSE(FILTER(A$2:A, NOT(COUNTIF({
INDIRECT("C2:C"&ROW()-1); INDIRECT("C"&ROW()+1&":C")}, A$2:A)), A$2:A<>""))

How to get the sum of values of a column in tmap?

I have 2 columns - Matches(Integer), Accounts_type(String). And i want to create a third column where i want to get proportions of matches played by different account types. I am new to Talend & am facing issue with this for past 2 days & did a lot of research but to no avail. Please help..
You can do it like this:
You need to read your source data twice (I used tFixedFlowInput_1 and tFixedFlowInput_2 with the same data). The idea is to calculate the total of your matches in tAggregateRow_1, it simply does a sum of all Matches without a group by column, then use that as a lookup.
The tMap then joins your source data with the calculated total. Since the total will always be one record, you don't need any join column. You then simply divide Matches by Total as required.
This is supposing you have unique values in Account_type; if you don't, you need to add another tAggregateRow between your source and tMap_1, in order to get sum of Matches for each Account_type (group by Account_type).

Power Query, avg value based on the values appearing within a specified date range

Context:
I have a data set for the weights of truck and trailer combinations coming into my site over the span of a few years. I have organized my data by seasons as I am trying to prove that the truck:trailers in winter are noticeably heavier due to ice, snow, and mud. The theory is, if the tare weight is higher in this season (the weight of the truck after it empties its load) than its Avg tare weight (which I need to calculate from the data) it can be deduced that the truck:trailer combinations are coming in with extra weight that we pay for in part as some snow/ice/mud falls off in the trailer emptying process.
What I've done so far:
I've defined a custom date range for my seasons
I've grouped Truck:Trailer by: count to get a duplicates column and, all rows to keep all my details
I've filtered out every combination I've seen less than 50 times, as i want good representation for each truck:trailer combo so that I can better emphasize repeated patterns
I've added an index column to better keep track of the individuals before expanding the details
What I need to do:
I only want to work with truck:trailer combinations which have weighed in for all four seasons at least once
I need to find the average tare weight of the truck:trailer combinations based over the extended range for both summer and autumn (the dry time of the year) while preserving the raw tare data for all seasons, as I need to eventually compare the winter tare values to this average.
example of my data
When I'm finished I'd like the data to look something like this
Pivot Chart
query data
For your first question (all seasons) you can add a column that holds the distinct count of the values in [Season] for each [Driver:Trailer]. Then filter your table on that column, keeping only the 4's. To achieve this, add the following m-code to your script in the Advanced Editor. Change the part after in to #"DistinctCount Season"
#"DistinctCount Season" = Table.Join(#"insert name previous step","Driver:Trailer",
Table.Group(#"insert name previous step", {"Driver:Trailer"},
{{"DistinctCountSeasons", each Table.RowCount(Table.Distinct(_,"Season")),
type number}}),"Driver:Trailer")
Insert the name of your previous step where indicated.
For second question:
You can use a matrix-visual for that in you report. First create a measure:
[AverageTare] = AVERAGE(table'[Tare])
Then put [Season] on Rows and the [AverageTare] on Values. You can create a group (right-click on [Season] in the FIELDS-pain) called [DrySeason], to combine the values for Spring and Summer.
If that doesn't work for you, explore the AVERAGEX function.
EDIT
In excel you can use a pivottable. Put [Season] on Rows and the [AverageTare] on Values. Right-click a value in the pivottable. Select Value Field Setting and choose Average. Then select the Seasons you want to group, right-click and select Group.
EDIT 2
To add a column in the Power Query Editor that holds the average [Tare] for the [Season] in each row, add the following steps to your script in the Avanced Editor:
#"GroupedSeasonAvg" = Table.Group(#"Insert name previous step", {"Season"}, {{"AVG", each List.Average([Tare]), type number}}),
#"JoinOnSeason" = Table.NestedJoin(#"Insert name previous step",{"Season"},GroupedSeasonAvg,{"Season"},"AVGGrouped"),
#"ExtractSeasonAVG" = Table.ExpandTableColumn(JoinOnSeason, "AVGGrouped", {"AVG"}, {"SeasonAVG"})
It works something like this:
"GroupedSeasonAvg" : Creates a table with the avereges for each [Season]
"JoinOnSeason": Creates a new column with tables joining the [Season] value for each row to [Season] in the grouped table.
#"ExtractSeasonAVG": Expand each table and keep only [AVG].

SSRS - Merge Repeating Texboxes w/ Distinct Row Values

Everything except for the name may or may not be different, but it doesn't matter.
How do you make it so the name and address (first column) can only show once if the value on multiple rows is the same? There is no way to merge the rows together due to the numbers of rows being generated from a group expression. But if there is another way to merge then can someone tell me how to do it? If not, then is there at least a way to blank out the second and third repeating names (and address)?
This is how you hide repeating values in a tablix column.
In design mode, click on the detail cell that you want to keep from repeating if the values are the same. In this case, you are referring to that one as the name and address column.
Look for the HideDuplicates property in the Properties pane. Set the value to the name of the dataset the tablix is using.
Now, when you run the report, that value should only show once. The other rows where the value had been repeating will be blank in that cell.
Set the borders appropriately (none, or solid) to make it look like the cells are merged. Doing the above alone will not merge the cells. Only a row group will do that.

How can I get the values in the Matrix on my SSRS report to repeat?

I know there must be a simple answer to this, but I can't find it.
I have added a couple of textboxes to a Matrix in a BIDS/SSRS report. I've given these textboxes values such as:
=Fields!WEEK1USAGE.Value
It works (after a fashion); when I run the report (either on the Preview tab, or on the Report Server site) I see the first corresponding data value on the report - but only one.
I would think that once a value has been assigned via expressions such as "=Fields!WEEK1USAGE.Value", each value would display (rows would automatically be added).
There must be some property on the Matrix or the textbox that specified this, but I can't see what it might be.
Here is how my report looks (very minimalistic, so far) in the Layout pane:
...and after running, on the Preview tab:
Obviously, I want the report to display as many rows as necessary, not just one. The textboxes do have a "RepeatWith" property, but there description doesn't sound interesting/useful/promising.
I don't see any property on the Matrix control that looks right, either.
I thought maybe the designer was only showing one row of values, and ran the report on the server, too, but there also it just shows the two values.
So what do I need to do to get all the data for a provided field?
Matrices are for display of grouped data and summary information, usually in a horizontally expanding pivot table type of format. Is a matrix really what you are after? Looking at your expression you have =Fields!Week1Usage.Value but in a matrix what I expect to see would be at least =Sum(Fields!Week1Usage.Value) or even better just =Sum(Fields!Usage.Value). Then you would have ProactDescription as your row group and the week as your column group and it would all just work out everything for you, grouping and summing by Proact vertically and expanding the weeks out horizontally.
What seems to be happening is that you have no grouping on rows or columns and no aggregation so it is falling back to the default display which is effectively the First function - it displays the first row of data and as far as the matrix is concerned it has done its job because there is no grouping.
Without knowing your problem or data, I'll make up a scenario that might be what you are doing and discuss how the matrix does the heavy lifting to solve that problem. Let's say you have usage data for multiple Proacts. Each time one is used you record the usage amount and the date and time it is used. It could be used multiple times per day but certainly multiple times in a week. So you might be able to get the times each Proact is used from a table like so:
SELECT ProactDescription, TimeUsed, Usage
FROM ProactUsage
ORDER BY ProactDescription, TimeUsed
In your report you want to show the total weekly usage for each Proact over multiple weeks. Something like this:
Proact Week1 Week2 Week3 ...
Description Usage Usage Usage ...
--------------------------------------------
Anise, Fennel 1 CT 20.00 22.50 16.35 ...
St John's Wort 15.20 33.90 28.25 ...
...
and so on. Using a dataset based on the SQL above we create a matrix and in the row group properties we group on =Fields!ProactDescription.Value and in the column group properties we group on a week expression like =DateDiff(DateInterval.Week, Fields!TimeUsed.Value, Today) and then in the intersection of the row and column we put =Sum(Fields!Usage.Value). To display the header of the column nicely put an expression like
="Week " & DateDiff(DateInterval.Week, Fields!TimeUsed.Value, Today)
The matrix automatically does all the summing by week and product and expands the weeks horizontally for as many as you are reporting. For bonus points you can also put totaling at the end of the columns and the rows to show the total use of that Proact for the period (row total) and total use of all Proacts in that week (column total).

Resources