I am new to Tableau and realized that Tableau is way different to power-BI. I am struct with this challenge in Tableau. I have data having ID as a column. I want to create a new column Repeated_ID which checks if the IDs in ID column are repeated. If an ID exists more than once in the column, Repeated_ID column should be "Yes" else "No".
This is how my result should look like:
ID Repeated_ID
1 Yes
2 No
3 No
1 Yes
4 Yes
5 No
4 Yes
Can anyone help me with this?
Create a calculated field : Repeated_ID
IF COUNT([ID]) > 1
THEN "Yes"
ELSE "No"
END
Related
I have a Google form accepting data from different users, which goes to a sheet and is used to SUM the values across columns at the end of the day. The problem is that users can re-submit forms to update the data totals if there is a change at the end of the day:
NAME K L M
ALF 4 0 1
BILL 1 0 0
SALLY 1 0 1
DENNIS 1 1 1
RICK 0 0 1
SALLY 2 1 1 <--- SALLY RESUBMITTED HER FORM AGAIN WITH UPDATED VALUES
In my current Query, I SUM() the columns after filtering by the date like this:
SELECT SUM(K), SUM(M), SUM(N) WHERE C = date '"&TEXT($B$1,"yyyy-mm-dd")&
$B$1 is a cell with a datepicker and col C is the user submitted form date. Col A has the unique form generated submission timestamps
As you can see, the SUM for each column will be off by the extra submission from Sally. I need to include only the most recent submissions from any of the users, and ignore any prior ones for this date. I'm not sure how to filter in this manner and sum just the most recent instance from each unique user.
** EDIT **
I should note the original form data is on another sheet and the cells are referenced via a query to this range. The form is also submitted daily, so the query must be able to specify the date in question for summation of entries.
Give a try on following formula-
=QUERY(INDEX(REDUCE({0,0,0,0},UNIQUE(J2:J7),LAMBDA(a,b,{a;SORTN(FILTER(J2:M7,J2:J7=b,C2:C7=date(2023,2,17)),1)})))," select sum(Col2), sum(Col3), sum(Col4)")
If you actually want most recent response to sum then use-
=QUERY(INDEX(REDUCE(SEQUENCE(1,COLUMNS(A2:M7),0,0),UNIQUE(J2:J7),LAMBDA(a,b,{a;QUERY(SORT(FILTER(A2:M7,J2:J7=b),1,0),"limit 1")}))),"select sum(Col11), sum(Col12), sum(Col13)")
Here you have another option, creating an auxiliary column that returns 1 if it corresponds to the date and is the last timestamp
=QUERY({K:M,
MAP(A:A,C:C,J:J,LAMBDA(ts,date,n,IF(date<>B1,0,IF(ts=MAX(FILTER(A:A,J:J=n,C:C=date)),1,0))))},
"SELECT SUM(Col1),SUM(Col2),SUM(Col3) where Col4=1")
I'm wondering if there is a formula that can return "Yes" after searching 3 columns and finding 3 exact matches, or "No" if not.
For example, I'd search Column A for "Lizzie", Column D for "10", and Column E for "Approved" and would like "Yes" returned if all 3 values are found in relevant columns, and "No" returned if only 1 or 2 or less are found
The issue is I can't specify which cell exactly to look in e.g. A278 for Lizzie, as due to filtering on the sheet the value in the cell may change position.
I tried the following but it returns "N" even when "Lizzie", "Approved" and "10" are all in relevant columns, but I'm not sure what the workaround is:
=IF(AND(Sheet1!A:A="Lizzie",Sheet1!E:E="Approved",Sheet1!D:D="10"),"Y","N")
The context behind this search is so I can see who has proofread and approved certain pages of a catalogue in a simple table which will be formatted as such:
Here's a sample setup as in your screenshot and you may have to adapt it to your design
formula in cell H3 for Lizzie:
=INDEX(IF(LEN(H$2:$2),IF(ISERROR(HLOOKUP(G3&H$2:$2&"Approved",TRANSPOSE(A:A&D:D&E:E),1,)),"N","Y"),))
I am trying to count the unique values of a column, based on their status in another column, example:
Customers
License Active
Adam
Yes
Barry
No
Adam
No
Claire
No
In this situation, I want to know how many customers have at least 1 active license, and how many customers do not have at least one active license.
The formula I have tried is:
=COUNTUNIQUEIFS(A2:A,B2:B,"Yes")
This returns 1 in this situation which is correct, as there is 1 customer who has a Yes on column B.
My issue is when I try to do the reverse, count the "No" using this formula:
=COUNTUNIQUEIFS(A2:A,B2:B,"No") it returns 3 which is not the desired result as it is counting the second Adam as a unique value too because they have a "No" in column B.
The result I want here is 2, because Adam has a yes somewhere in column B so I don't want him counted again the next time his field is counted.
It seems to me that the easiest way to get the "No" count is like this:
=COUNTUNIQUE(A2:A)-COUNTUNIQUEIFS(A2:A,B2:B,"Yes")
It's even easier if you've already pulled the "Yes" count to a cell (say, C2), in which case the "No" count could be gained quite simply with this:
=COUNTUNIQUE(A2:A)-C2
I don't think you can do it in a single step - try filtering out those with at least one "Yes" like this:
=countunique(filter(A2:A,countifs(B2:B,"Yes",A2:A,A2:A)=0))
Explanation
When a countifs has a range instead of a single value in its criteria part countifs(B2:B,"Yes",A2:A,A2:A) , the countifs gets re-evaluated for each cell in the range. So you get an array with the results of
countifs(B2:B,"Yes",A2:A,A2)
countifs(B2:B,"Yes",A2:A,A3)
countifs(B2:B,"Yes",A2:A,A4)
countifs(B2:B,"Yes",A2:A,A5)
and so on all the way down the columns.
The first countifs above checks right through a2:a and b2:b to see if there are any cases where the name is Adam and the license condition is true and gets a count of 1 so that row is filtered out. The same thing happens in the next row containing Adam (row 4) - the countifs checks right through both columns excluding the headers and the count is still 1 so that row is filtered out as well leaving just Barry and Claire.
If you wanted to exclude all records containing "Test" in the Customer column, You could add a condition to the filter using the multiplication operator to 'AND' it with the existing condition:
=countunique(filter(A2:A,(countifs(B2:B,"Yes",A2:A,A2:A)=0)*(A2:A<>"Test")))
If you had several names to exclude, you would probably want to make a list of them and use a lookup to stop the formula getting too long and unwieldy, but it would be the same idea.
I Need help to apply data validation by referencing from another column with a specific value.
In the given link for google sheet, I have some data where I need to restrict entry of duplicate data only if value from ColumnA is repeated and in ColumnC value is 1 but if value in ColumnC is 0 and data in ColumnA is repeated it should allow it.
https://docs.google.com/spreadsheets/d/1jIfIrB2RsCIyfk-64iyzNGz91oT82C56TDffVeFGLL0/edit?usp=sharing
Note: I have highlighted the rows which need to fixed using any solution. Solution should not allow data entry in row17 with value 1 in ColumnC as it's already available in row7 with value 1 in ColumnC.
I've created a sheet in your file 'Aresvik solution', but an anonymous user keeps altering your file so I've created another file for you here:
https://docs.google.com/spreadsheets/d/11y1cce5pNRh9KDifzZZg_VmsmWh2xrv4bBDDwM2awa8/copy
Using query, it filters out rows where Col2>1 and Col3=1:
=query({Sheet1!A:C},"where not (Col2>1 and Col3=1)",1)
Not sure what your intention is with 1230A, value 1? If you only want to ignore dupes where status = 1, then try:
=arrayformula(query({Sheet1!A:C,if(Sheet1!C:C=1,countifs(Sheet1!A:A&"-"&Sheet1!C:C,Sheet1!A:A&"-"&Sheet1!C:C),)},"select Col1,Col2,Col3 where Col4 is null or Col4=1",1))
If you want a warning when there is a duplicate status of 1, try this in cell D1:
=arrayformula({"Warning";if(if(Sheet1!C2:C=1,countifs(Sheet1!A2:A&"-"&Sheet1!C2:C,Sheet1!A2:A&"-"&Sheet1!C2:C),)>1,"Issue",)})
I am using google sheets to do the following.
Sheet 1 : 1 column for each person who needs access to the file. Each column's cell has a dropdown menu so people can select what items they have.
Sheet 2 : A list of every item in column A, columns B through G are the names of the people.
What I am trying to do is to have on sheet 2, the words "YES" or "NO" appear under each person's name if they have selected the item whatever the order.
So if Person 1 picks in the dropdown of sheet 1 that they have Item 1, Item 3, Item 2 in this order, I want sheet 2 to show the "YES" or "NO" mention. I don't want the order of the items in the list to be an issue.
So far, I have tried these 2 methods :
=IF('Sheet1'!A2:A25=A2;"YES";"NO")
=IF(RegExMatch('Sheet1'!A2:A25;A2);"YES";"NO")
These do not work as the items must be selected in the same order as they appear in the second sheet. Is there another function that can validate a list in any order and apply the appropriate value?
Thanks ahead!
Jason
Edit : https://docs.google.com/spreadsheets/d/1cNn7G9x9o56d_9qM18s3AULkhpfOV5Y-b55vycCUyLY/edit?usp=sharing
Sheet2!B2:
=ARRAYFORMULA(IF(ISERROR(MATCH($A$2:$A$100;Sheet1!A2:A25;0));false;true))
MATCH Sheet1A column against Sheet2A column
IF MATCH returns error, FALSE, else TRUE.