take action when two specific values are selected in a Qlikview listbox - listbox

Quick QlikView 11 question: I have a ListBox associated with Customers (a column from a database table).
Of course, the Customers tables has many different values, but I am interested in showing "YES" in a textbox when values "Customer A" and "Customer B" are selected by the user from that ListBox.
What I tried so far:
=if(Customers="Customer A" AND Customers="Customer B", "YES", "NO")
This doesn't work.
(I obtain "NO" as a result instead of "YES", despire the fact the two mentioned values are selected from the ListBox)
Any help is much appreciated. Thank you.

Well, I found this to work:
if( SubStringCount ( GetFieldSelections(Customers),'Customer A,Customer B') >= 1 OR SubStringCount ( GetFieldSelections(Customers),'Customer B,Customer A') >= 1 , 'Yes', 'No')
If anyone has other ideas, feel free to mention them. This is just one possible solution.

Related

Google Sheets - Return "Yes" or "No" if 3 criteria across 3 different columns are found

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"),))

Making data appear from a dropdown list in Google Sheets

I'm trying to create a sheet that allows me to compare four different properties I'm considering taking a mortgage out on. It contains ranges where I input data (property value, deposit percentage etc) for each of the four properties, and then this feeds into four property displays below which shows me my monthly outgoings for each property.
I'm looking for a way to only see one data input range at a time, using a dropdown to access it. So I could select "Property 1" from the dropdown, it would bring up my Property 1 data input range, I could add the relevant information, and then select Property 2 and do the same etc.
I've tried creating each input range as a named range, and then using =IF to call them like this:
=IF(C8="Property 1",Property_one)
But this just brings up #VALUE! and the error "An array value could not be found."
Any help would be appreciated! Here's a copy of the sheet I've been working on – you can see where I've been faffing around with the =IF function at the bottom.
Thanks in advance!
try:
=INDEX(IF(C8="Property 1", Property_one, ))
or:
=INDEX(IF(C8="Property 1", Property_one,
IF(C8="Property 2", Property_two,
IF(C8="Property 3", Property_three,
IF(C8="Property 4", Property_four, )))))

How To Determine Match from Multiple Cells in One Row

Editable Test Sheet:
https://docs.google.com/spreadsheets/d/1zKtE09TB-mAEQFRswity3R1ZGdYe7jq6ZYh_l4P398E/edit?usp=sharing
Although I believe what I'm trying to do is fairly simple, It is difficult for me to even find the correct words to describe what I'm trying to do. I suspect that is why I've been researching all day for an answer and cannot find it.
I need an ARRAYFORMULA that can check for the existence of a given "PARENT ID" in another table, but only if another cell in the same row is not true.
A given PARENT ID from TABLE 2 could appear in TABLE 1 multiple times, sometimes paired with "TRUE" and sometimes not. I only need to know if the PARENT ID from TABLE 1 appears in TABLE 2 along with the value TRUE in the "Done" column next to it. If it appears even once, I want to denote it in TABLE 2.
I am able to do this in various forms, but none of them work with ARRAYFORMULA.
See the shared example sheet above. I would greatly appreciate any help.
See my two newly added sheets ("Erik Help" and "Erik Help 2"). Below are the formulas I used:
In "Erik Help":
=ArrayFormula({"In Table 1 and Not Done?";IF(E3:E="",,IF(ISERROR(VLOOKUP(E3:E,TRIM(B3:B&C3:C),1,FALSE)),,TRUE))})
This delivers the results you want as asked (though your manually entered results did not list F3 as TRUE when I believe it should be).
The trick here is looking for the Parent ID within a virtual column that concatenates Col B and Col C and then TRIMs out extra characters (such as null). If there is an exact match, we know that there was no value in Col B. And since the only valid Col-B value is Boolean TRUE, we are assured that any match is in effect false (or not Done).
In "Erik Help 2":
=ArrayFormula({"In Table 1 and Not Done?";IF(E3:E="",,IF(ISERROR(VLOOKUP(E3:E,TRIM(B3:B&C3:C),1,FALSE)),,IFERROR("Item ID(s): "&VLOOKUP(E3:E,REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(QUERY({FILTER(C3:C,A3:A<>"",B3:B<>TRUE)&"~",FILTER(A3:A&" (R"&ROW(A3:A)&")",A3:A<>"",B3:B<>TRUE)&","}, "Select MAX(Col2) GROUP BY Col2 PIVOT Col1"),, 9^9)),"~")),"[,\s]+$",""),2,FALSE),TRUE)))})
Instead of simply TRUE, this version returns the Item ID(s) that are not done for that Parent ID along with the row number where each incomplete Item ID is found.
Since you didn't expressly ask for this, I'm considering it bonus material and will not take time to explain it.
Another answer I received on another forum:
=ArrayFormula(IF(COUNTIF(C3:C&B3:B,E3:E),true,))
Credit to Prashanth KV

How would I conditionally format a cell based on conditions being true in the sheet?

I choose to edit the problem instead of having it spread out in the comments section.
"List of Invaders" - The names here, I want to be automatically crossed out when certain conditions are met. These conditions are: When all of the corresponding "invader" names are marked as "complete" with a "1" instead of the "0" in the corresponding "Completed" and "Crafted" columns. The light blue columns are where the names are "hidden" for the formulas to get info from.
So far, the marked answer was working for the initial intention, the problem arose when I wanted to add more columns for the array and or formula to look at.
I added a text box to the spreadsheet to explain what it is that should happen.
Link to the spreadsheet: https://docs.google.com/spreadsheets/d/1P1Nbt8Ct8pem0AqHwjvroX96hHDkrXwqPUZqngGEdFE/edit?usp=sharing
You are free to edit this one for testing. It is just a copy.
Thanks for all the help so far! And I apologize if I am causing confusion as to what I want, I hope this new example helps clear it up.
=ARRAYFORMULA(IFERROR(REGEXEXTRACT(G3:3, JOIN("|", QUERY(VLOOKUP(
QUERY($E4:F, "select E where E is not null order by F"),
QUERY($E4:F, "where E is not null order by F"), {1,2}, 0), "select Col1 where Col2=1")))))
=ARRAYFORMULA(IFERROR(REGEXEXTRACT(G3:3, JOIN("|", QUERY($E4:F, "select E where F=1")))))
Another way to do this without an array formula would be
=AND(COUNTIF($E:$E,"="&G3)=SUMIF($E:$E,"="&G3,$F:$F),SUMIF($E:$E,"="&G$3,$F:$F)>0)
and apply it to the range G3:V3 which is all of your invaders listed.

Google Sheets, need to edit a column based on two columns on a second sheet

Good morning!
I've been searching high and low for how to do this, and while I feel like I get close I can't get anything more than 'invalid formula' from the conditional formatting in google sheets. So here's what I'm trying to do;
Column C on sheet 1 (Working List) needs to have a red background if the following conditions are met;
Column 'P' on sheet 2 (Complete) has the 'Address Changed' option in the drop down box (its the first one on the drop down, I've been struggling to figure out if it needs to be a '0' given its position in the list or if its 'Address Changed')
Column 'C' on sheet 2 has the same account numbers in Column 'C' on sheet 1.
I can set it up to find duplicate accounts, but I can't seem to figure out how to get the first rule for the drop down box to work. Advice?
Attempts thus far, none of them worked, all were tried separately and not in conjunction with each other. Google just says 'invalid formula' and won't save it or do anything with it.
=and(EQ(Complete!$O, "Address Changed"), EQ('Working List'!$C, Complete!$C))
=match($C2, indirect("Complete!$C:$C"), 0)
=if(EQ, indirect("Complete!$O, "Address Changed""), EQ('Working List'!$C, "Completed!$C"))
=and(indirect("Complete!$O:$O,$O="Address Changed""))
so I've tried to figure out a better way to get it working, and this is what I think might be closer to the answer.
=and(if($O:$O,indirect("Complete!$O:$O),0)),[match($C2,indirect("Complete!$C:$C"),0)]
***Friend helped me solve this. The following worked for what I needed....
=index(indirect("Sheet2!O:O"), match(C1, indirect("Sheet2!C:C"), 0)) = "Address Changed"
Take a look at this sheet with some foo data I built based on your sheet.
https://docs.google.com/spreadsheets/d/1RcM5WX3KWgWq-WWuPgyF-PZe3RP99qWF-IRpSr35Zik/edit?usp=sharing
I used some helper column, as you see.
if sheet2!P1 is changed to "Address Changed" K1 will have value of 1. This is a simple IF function.
if sheet2!C = sheet1!C, L will change to 1. This is another simple ARRAYFORMULA(IF())
Finally, column C will be formatted with the data from K1 and L by this formula
: =AND(L2=1, $K$2=1)
You can then hide the helper column / cell.
If you don't want to use helper column, look at the formula in column D :
=AND(INDIRECT("Sheet2!C2:C") = C2:C, INDIRECT("Sheet2!P1")="Address Changed")
This will serve your purpose.
You cannot refer to another sheet directly in conditional format formula, hence if you don't want to use helper column, you will have to use INDIRECT. This is also the reason why your formula failed in the first place.
I personally wouldn't recommend you to use INDIRECT though...

Resources