I am trying to add an if function to my vlookup.
current formula: =vlookup("*treasury*",'January (1/22)'!B:E,4,false)
I want to add another condition for it to check if the row that the information exist on is check marked (column "J" in this example). If so, then display the vlookup.
My column "J" has checkboxes.
try:
=IFNA(FILTER(Sheet1!E2:E, Sheet1!J2:J=TRUE, REGEXMATCH(Sheet1!B2:B, "(?i)treasury")))
Related
I am using APEX 21.1. I have a checkbox group whose list of values is retrieved using a query...
select disease, id from history;
The query returns many checkboxes. I have another textarea item. I need to get the display value for any checkbox whenever it's checked and set item HISTORY to that value. How to do so?
Describing a how-to would be so much easier if you had provided some example page item names and example data. So, lets call your checkbox group P10_CHECKBOX and your textarea P10_TEXT.
Usually, your checkbox group will save the item ids as a colon seperated list, like this: 3:4:5
To display the corresponding display values, make a dynamic action on change on your item P10_CHECKBOX.
Then, use an action of type Execute PL/SQL Code to fetch the display values of your items.
The code could look like this:
select listagg(disease,chr(10)) within group (order by disease) into :P10_TEXT
from history h
join table(apex_string.split_numbers(:P10_CHECKBOX,':')) t on (h.id = t.column_value);
apex_string.split_numbers will convert your colon list into an actual "table" with the column column_value you can use in the join clause. listagg will do the actual concatenation and will work up to a couple thousand characters. chr(10) is an ordinary line break and will have your items be shown line by line, but any other seperator will do.
Last step is to set up P10_CHECKBOX in your Items to submit and P10_TEXT in your Items to return.
Now, whenever you click a checkbox, the textarea will be updated immediately.
I have two lists of people - they will not be sorted in the same order. The second list is in a different sheet. If the person listed in column A shows up in Column A in the second sheet, I want column F to display "Y." If not, I want column F to display "N."
This formula: =ArrayFormula(vlookup(A2:A,Attendees!A2:A,1,0)) almost gets me there, but I can't figure out how to get it to return Y/N instead of the name of the Attendee or not.
Any ideas?
try:
=ARRAYFORMULA(IF(IFNA(VLOOKUP(A2:A, Attendees!A2:A, 1, 0))="", "No", "Yes"))
I'm making a Microsoft Access table where one of the fields is a list of pre-made options. When I make a SQL query on that table it returns the values of the list as strings containing the spelled out choice. I would like to assign numerical values to each element of the list so a SQL query returns a number instead. How do I do this? I know it's possible because I have an access file with such a list but I'm unable to recreate it.
An easy way to do this is to have your combo box use a query of the table as a Rowsource. This query would have the table unique ID in the first field and the field you wish to return as the second field. Then change the setting on the combo box for "Column Count" to 2. If you want to show both fields change the "Column Widths" value to 1"; 1". If you want to show only one field, change the value of one you do not want to see to 0. Now we you refer to this list in an SQL queries, it will use the ID field but show the user the string field.
I'm want to conditionally format A3:A if the value entered in A3:A already appears in B3:B, which contains CSV, >1 time.
(A3:A will be CONCATENATED to B3:B, so the value will automatically appear at least once.)
Basically, if the value is not already present, there will be no formatting and I know to go ahead and add (leave it). If it is present, format the cell to alert me not to add (or delete). There may be numerous values in some cells and not so easy to glance to see if the value in question is already present.
I attempted to use REGEXMATCH, but not really sure how to switch the TRUE to a numeric value.
=IF(LEN(A3),REGEXMATCH(B3,A3),)
I've also found other formulas using COUNTIF and COUNTA that perform a similar action, but none that consider CSV.
My sheet
custom formula for CF:
=ARRAYFORMULA(REGEXMATCH(A3,TEXTJOIN("|",1,TRANSPOSE(QUERY(QUERY(TRANSPOSE(TRIM(
SPLIT(B3,","))), "select Col1,count(Col1) group by Col1"),
"select Col1 where Col2 > 1", 0)))))
I have a QTableView and I need to the get value (string) from the first cell of the selected row (any cell on the row could be selected). But I need this value only if exactly one row was selected.
I thought - I need to get index of the selected row and then get the value of the first сell on that line, but I couldn't find a way to do it.
myTableView->selectionModel()->currentIndex().row()
Will give you the index of the currently selected row. From there you should have enough information to look up the row/column pair in your model.
Also, QItemSelectionModel::selectedRows() will let you know how many rows are selected.
Python Code will look like :
self.tableView.clicked.connect(self.on_Click)
When User Click on Table Cell the on_Click() method is invoked
def on_Click(self):
# #selected cell value.
index=(self.tableView.selectionModel().currentIndex())
# print(index)
value=index.sibling(index.row(),index.column()).data()
print(value)
Explanation.
"value" contains the cell value of the selected cell.
index.row() # gives current selected row.
index.column() # gives current selected column.
index.sibling(index.row(),index.column()).data() # will return cell data