Can you help me when I select Desc in dropdown list google sheet I want the value become unique number - validation

I have a google Spreadsheet.
Column A = Unique number,
Column B = Desc
In column C, I use data validation from column B. I want when I select 1 value the result in column C should be column A. I tried include image to become more clear. Do you have any ideas?
Thank you.

use:
=IFNA(VLOOKUP(D3, {B:B, A:A}, 2, 0))
or:
=IFNA(FILTER(B:B, A:A=D3))

Related

Small detail when using this function in Google Sheets

Small detail when using =INDEX($A$8:$A$11;MATCH(MAX(SUMIF($B$8:$B$11;$B$8:$B$11));SUMIF($B$8:$B$11;$B$8:$B$11);0))) If the values in column B are all different it returns the correct date value, but if two identical values in column B coincide in different dates then it returns the date of the first value; it does not return the correct date and it keeps the first one that has the repeated value.
Any idea?
p.s This question can be added to this post
Even more easier way:
On E2 Try this =TRANSPOSE(INDEX(QUERY(A1:B," select A, sum(B) group by A Order By sum(B) Desc "),2))
and format the date and currency accordingly.
You can do that easily and differently to get:
1 - Make a helper table to get unique dates, You can use two ways
a) - Use SUMIF Function to get the sum of Expenditure in each unique date Like so =IF(D2="",,SUMIF($A$2:$A,D2,$B$2:$B)) and drag it down.
b) - By using QUERY Function =QUERY(A1:B11," select A, sum(B) group by A Order By sum(B) Desc ")
2 - to get SUM BY DATE OF HIGHEST EXPENDITURE: =MAX(E2:E)
3 - to get DATE BY HIGHEST EXPENDITURE: =INDEX($D$2:$D,MATCH($H$3,$E$2:$E,0),1)
Make a copy of this sheet "make it yours."
Hope that answerd your question.

i want to display the latest price of assigned code from another sheet in google sheet

I have a sheet along with this message. I want to display the latest price for the code which i already purchased earlier(in second sheet 'price history') lets assume that price shown in the topmost of the table is purchased first. so i want to know the latest price which come downwards using importrange. maybe displaying the price in descending order will help me out.
use:
=QUERY(SORTN(SORT({A2:B, ROW(A2:A)}, 3, 0), 99^99, 2, 1, 1),
"select Col1,Col2 where Col1 is not null", 0)
Assuming you have dates in column C in Sheet 2
Try below formula:
Formula in C2 in Sheet1
=IFERROR(ArrayFormula(vlookup(B2:B,sort(Sheet2!A2:C,Sheet2!A2:A,True,Sheet2!C2:C,False),2,0)))

Duplicate removal from a table using Informatica

I have a scenario to be implemented in informatica where I need to remove duplicate records from a table based on PK. But I need to keep the 1st occurrence of the PK values and remove the others(in case of duplicate PK).
For example, If my source has 1,1,1,2,3,3,4,5,4. I want to see my target data as 1,2,3,4,5. I have to read data from the same table and need to load into the same table., no new table can be introduced. please help me with your inputs.
Thanks in Advance!
I suppose you want the first occurrence because there are other (data) columns in addition to the key you entered. Therefore you want
1,b
1,c
1,a
2,d
3,c
3,d
4,e
5,f
4,b
Turned into
1,b
2,d
3,c
4,e
5,f
??
In that case try this mapping layout:
SRC -> SQ -> SRT -> AGG -> TGT
SEQ /
Where the sorter is set to sort on the KEY,sequence_port (desc)
And the aggregator is set to group by the KEY, and the sequence_port should not go out of the sorter
Hope you can follow me :)
There are multiple ways to do this, the simplest would be too do it in the SQL override.
Assuming the example quoted above, the SQL would be like this. General idea is to set a row number for a primary key ( so if you have 3 rows with same pk they will have 1,2,3 as row numbers before being reset for the next pk)
SQL:
select * from (
Select primary_key,column2 row_number() over (partition by primary_key order by primary_key) as distinct_key) where distinct_key=1
Before:
1,b
1,c
1,a
2,d
3,c
3,d
Intermediate query:
1,c,1
1,a,2
2,d,1
3,c,1
3,d,2
output:
1,c
2,d
3,d
I am able to achieve this by following the below steps.
1. Passing Sorted data(keys are EMP_ID, MOBILE, DEPTID) to an expression.
2. Creating the following variable ports in the expression and getting the counts.
V_CURR_EMP_ID = EMP_ID
V_CURR_MOBILE = MOBILE
V_CURR_DEPTID = DEPTID
V_COUNT =
IIF(V_CURR_EMP_ID=V_PREV_EMP_ID AND V_CURR_MOBILE=V_PREV_MOBILE AND V_CURR_DEPTID=V_PREV_DEPTID ,V_COUNT+1,1)
V_PREV_EMP_ID = EMP_ID
V_PREV_MOBILE = MOBILE
V_PREV_DEPTID = DEPTID
O_COUNT =V_COUNT
3. In the next transformation which is filter, I am taking only the records which have count more than 1 and deleting them using update strategy(DD_DELETE).
Here is the mapping flow.
SQ->SRTR->EXP->FIL->UPD->TGT
Also, when I tried to delete them using aggregator , it is deleting only the first occurrence of duplicates but not all.
Thanks again for your inputs!

Google Spreadsheet Dropdown Filter

I have Google spreadsheet with a list of names in a column. (EX: David, Daniel, John, Cooper).
I made a drop down list of those names. Lets say I two more columns with Age and Birthday.
I want to show the age and birthday column information pertaining to 'David' when I choose 'David' from the drop down list.
A drop down list acting as a 'in spreadsheet filter'.
Any way to do this?
Ive tried the =FILTER() and =UNIQUE() but they don't quite get me what I want. Thanks for the help
Assuming you have the drop down list in cell A1 (of sheet 2) and the columns with data are in sheet1
col A names
col B age
col C birthday
in cell B1 (of sheet2)
=QUERY(Sheet1!A1:C, "Select B, C where A = """&A1&""" ", 1)

column B in sheet two equals column B in sheet one, if Column A is sheet two is equal to any value in Column A in sheet one

I have two excel sheets. They are formatted the same. Would you please show me the formula to figure out column B value if Column A in Sheet B match any value in Column A in Sheet A?
Sheet A
Column A Column B
Customer A $1.25
Customer B $1.00
Customer C $0.75
Sheet B
Column A Column B
Customer E ?
Customer B ?
Customer A ?
VLOOKUP is what you need to look at.
in cell B1 on sheet B, the formula =VLOOKUP(A1,SheetA!A1:B3,2,FALSE) would get you your data.
the four parameters for the function are:
What data you are looking for
Where to look for the item referenced in part 1
What column from the data to return
If an exact match is needed (no sorting required), or close value will do (sorting required)
False = exact match

Resources