Checking thresholds and calculating the recovery time - excel

This is what I would like to have happen:
Car ID Sample point Date Viscosity Output
123456 1 01/01/2016 400
123456 2 01/01/2016 100
123456 3 01/01/2016 100
123456 1 01/06/2016 100
123456 2 01/06/2016 80
123456 3 01/06/2016 90
123457 1 01/01/2017 600
123457 2 01/01/2017 800
123457 3 01/01/2017 900
123457 1 01/06/2017 200
123457 2 01/06/2017 100
123457 3 01/06/2017 50
Max. Viscosity Threshold 300
Normal Viscosity Level 200
I wish to check a viscosity recovery. It means I would like to first check Car ID, Sample point , Viscosity Value.
If Viscosity value is higher >300
I would like to check the next data set (same ID, Same sample point, next date) if for the same sample point viscosity came back to the normal value (<200) if not, proceed to the next date.
When Sample ID is finished, proceed to the next ID.
Later on for all data sets I wish to calculate the average recovery time.
Example:
Step 1
Car ID 123456 Sample 1 Date 01/01/2016 Viscosity 400 Above Threshold
Step 2 'Checking for the Sample 1 next sampling if viscosity went lower then Normal threshold
Row 4 Car ID 123456 Sample 1 Date 1/06/2016 Viscosity 100 Below Normal Threshold
Output(recovery time): column 5: 5 months. End
Step 3 checking other sample point. If nothing finds, continue with the next car ID.
Please find here picture with the actual spreadsheet.

Related

Closest Combined Match in Excel

I need to come up with a formula that gives me the closest match based on multiple criteria.
This only applies for those names with Valid = "N" (Column I), or else their own name is returned.
For example, Bob has the closest numbers combined to Susan for each day.
I rearranged all of the "valid" names in the table to the right so that Bob does not return "Bob" as the closest match (since we only want to return names that are valid anyways).
I have attached an image of the data below (with column J being my desired results)
Name
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Valid (Y/N)
Desired Combined Closest Match
Calculated Closest Match
Bob
100
25
750
40
750
750
750
N
Susan
Susan
Susan
100
25
500
25
1000
1000
1000
Y
Susan
Susan
Karen
75
30
500
50
Y
Karen
Karen
Michele
100
30
500
50
Y
Michele
Michele
Tom
75
30
240
30
Y
Tom
Tom
Rob
100
30
1000
30
Y
Rob
Rob
Brian
100
30
1000
50
N
Rob
Susan
Stacy
100
30
500
50
Y
Stacy
Stacy
Rachel
100
30
500
50
2000
2000
2000
Y
Rachel
Rachel
Jeff
100
30
500
50
1000
1000
1000
N
Susan
Susan
I am able to do this only using 1 column of data, but I am unsure how to combine them. I used INDEX, MATCH, MIN, and ABS functions to figure out the closest match based on one column (Sunday). Here is an example of my formula for Brian (it is supposed to return "Rob" as the result, but returns "Susan" because I only am using one day of data):
=IF(I8="Y",A8,INDEX($M$2:$M$8,MATCH(MIN(ABS($N$2:$N$8-B8)),ABS($N$2:$N$8-B8),0)))

Spotfire calculate difference with respect to previous row value

I have a data as below. I have created column "difference in values" manually, the calculation is value at 8:15 AM - value at 8:00 AM which is 2 in second row and so on for all values of column Tushar and Lohit respectively. How can i do this calculation in Spotfire i believe over and previous function can help but i am unable find anything on this. Please help
Name Time Values Difference in values
Tushar 08:00 AM 2 0
Tushar 08:15 AM 4 2
Tushar 08:30 AM 5 1
Tushar 08:45 AM 6 1
Tushar 09:00 AM 7 1
Lohit 08:00 AM 2 0
Lohit 08:15 AM 4 2
Lohit 08:30 AM 5 1
Lohit 08:45 AM 6 1
This should work
SN([Values] - Max([Values]) over (Intersect(Previous([Time]),[Name])),0)
where Max(..) is just to have an aggregation, since it is only looking at the previous Time row for each value of Name. [so Min would work just as well].
SN(...) is there to set the result to 0 when it is empty (as in the first row of each Name).

1) Issue In Normalize Transformation for Informatica Power Center

I am Trying to Normalize Records of My SOurce table using Normalize Transformation in informatica, But Sequence are not re-generating for different rows.
Below Is SOurce Table :
Store_Name Sales_Quarter1 Sales_Quarter2 Sales_Quarter3 Sales_Quarter4
DELHI 150 240 455 100
MUMBAI 100 500 350 340
Target Table :
Store_name
Sales
Quarter
I am Using Occurrence - 4, on Sales Column for getting GCID Sales.
For Quarter, I am Using GCID Sales column :
O/P :
STORE_NAME SALES_COLUMN QUARTER
Mumbai 100 1
Mumbai 500 2
Mumbai 350 3
Mumbai 340 4
Delhi 150 5
Delhi 240 6
Delhi 455 7
Delhi 100 8
Why Quarter Value is not restarting from 1 for Delhi and is continuing from 5 ?
There is a GK column that keeps sequential numbers for all rows. Definitely, GCID is the right column that keeps numbers per multi-occurrences in a row. So, double check that there is GCID port and not GK that is linked to QUARTER port to target…
It’s good to provide a screenshot for the mapping and for the normalizer transformation (Normalizer tab) to be more informative about your question/issue…
But I suppose you have 'Store_Name' port at level 1 and all 'Sales_Quarter1', 'Sales_Quarter2', 'Sales_Quarter3' and 'Sales_Quarter4' ports grouped at level 2 on Normalizer tab (using >> button at top left area). And at group level (for these four ports) you set the Occurrence to 4.

Group by two columns and count and then compare

I have data in Excel that looks like this:
ID DATE COST TOTAL
1 01-01-18 50 100
1 01-01-18 25 100
1 01-01-18 25 100
2 01-03-18 25 100
2 01-03-18 25 100
2 01-03-18 50 100
1 02-01-18 100 100
I want to group by ID and Date then count the cost and ensure it quals to the total for that ID and date. So for example ID 1 and date 01-01-18 I want to count the 50 and 25 and 25 and compare it to 100 to return a true or false.
How can I do this?
SUMIFS will do what you want. Assuming your example data starts at A1, add a 5th column with this formula in cell E2:
=SUMIFS($C$2:$C$7,$A$2:$A$7,A2,$B$2:$B$7,B2)=D2
Then fill it down to cell E7.

Excel How to make a formula differenciate different vehicle plates

I have little knowlage of excel and I'm trying to configure an excel table so I can get the consumption of gas for each vehicle in a company, but all the data is introduced in only one table, how can I calculate the increase of km's of each vehicle to then be able to calculate the consumption?
The problem is that I don't know how to make the formula differenciate for each different plate.
The table is the following:
**A B C D E F G**
**1** Date Plate km Gas Signed Increased km's Consum
**2** 1/1/2018 0157-AAA 123456 50 YES
**3** 5/1/2018 0157-AAA 123789 20 NO
**4** 8/2/2018 0157-AAA 123987 30 NO
**5** 1/2/2018 0582-BBB 123456 40 YES
**6** 1/3/2018 0356-CCC 123456 30 NO
Another exemple:
Data Plate km Gas Increased km Consum %
3/5/2017 1111-AAA 150 20 150 13,33333333
7/5/2017 1111-AAA 400 30 250 12
7/5/2017 2222-BBB 50 10 50 20
7/5/2017 3333-CCC 20 5 20 25
10/5/2017 2222-BBB 200 30 150 20
Each plate is a different vehicle
Gas is the amount of oil that the vehicle refills in L
The table is updated daily or every 2-3 days as it's manually filled
The problem is calculating the increased km's as they may be other plates in between in the same date.
Consum % = Gas/Increased km *100
I thought about just ordering the columns by date and by plate and apply a general formula to everything
Thanks
I think I finally "solved my problem", the formula with the one I work is based on a filter for the plates in order to get them ordered. then the formula is:
Increased km =IF(B2=B1;C2-C1;C2)

Resources