How to use IF + VLOOKUP? - if-statement

I'm trying to see if it's possible to get a function between IF + VLOOKUP. I would like to have a table where I can select a specific cell and based on that command a specific set of information is shown. I have tried with SORT + FILTER but since I have more of less 23 different columns to choose from, the information wasn't displaying the way I wanted to.
What somehow I've managed to do is just a SORT based on the total results but I would love if I could create one that filters it based on the cell or condition I want.
Here's a link on a test I tried to do so I could better explain myself https://docs.google.com/spreadsheets/d/1i7f80FsWIMQtH1X6r7oEidymbJdGGJv2U5xQUZA7vC4/edit?usp=sharing
Thanks in advance for any suggestion that can help me or something near what I want.

try:
=QUERY(SORTN({Data!A2:A13, Data!AC2:AC13, Data!C2:C13}, 23,, 2, 1),
"select Col1,Col2 where Col3 = '"&D4&"'")

Related

Limited some column in queryset django

I tried many ways but all failed when trying to get some special columns in model.
My code:
or I use defer
test_detail=testimport.objects.defer("so_hd","noi_dung")
or I use only
test_detail=testimport.objects.only("so_hd","noi_dung")
or even use filter and defer/only
test_detail=testimport.objects.filters().def("so_hd","noi_dung")
When I print print(test_detail.values("ten_kh")), there are still results.
Because there are some columns I rarely use, so I want to save memory and improve speed if don't get there columns
Please help me
I think you might want to select specific columns of a table:
for this you need to use:
data = Model.objects.values('column_1', 'column_2')

Superset partion graph type order by

We are creating several charts in superset and with the partition type chart the ORDER BY seems to be hard coded and we cannot change it. The goal is too have the months on the left in the correct order (the column in this case is Month). When run in sql lab it works in correct order but in the chart view we cannot change the ordering
Any suggestions?
I assume you mean the dates on the right here?
I work with superset and I have experienced this limitation that does appear to be hard-coded into the ordering once a chart is made. I would suggest if it wasn't too much hassle to add another column to your database of the text value and follow the patter of;
WHERE "Month" = 'January' SET "OrderingColumn" = 'A'
WHERE "Month" = 'February' SET "OrderingColumn" = 'B'
etc etc
Then in your charts you can try: ORDER BY "OrderingColumn"
It is a bit of an inconvenience but if you are able to manipulate your data by changing tables or views this seems to be a solution you could use.
I hope this may be useful even to change the way of approaching the problem.

I want to turn this if formula into an array formula but cant seem to get it to auto populate down the rows

I want the driving distance between two address's and I am running a script that allows the following statement work.
This works but I have to drag the formula down when new rows are added from my mobile app into my sheet
=(IF(ISBLANK($AF2:$AF),"",DrivingMeters($E2:$E,$AF2:$AF)/1000))
This doesn't work
=ARRAYFORMULA(IF(ISBLANK($AF$2:$AF),"",DrivingMeters($E$2:$E,$AF$2:$AF)/1000))
I cant work out what I am doing wrong?
it could possible be you need to adjust your DrivingMeters custom formula to accept arrays. Please share the sheet or custom formula
try:
=ARRAYFORMULA(IF(AF2:AF="",, DrivingMeters(E2:E, AF2:AF)/1000))

Google Sheets Array formula for counting the number of values in each column

I'm trying to create an array formula to auto-populate the total count of values for each column as columns are added.
I've tried doing this using a combination of count and indirect, as well as tried my hand at query, but I can't seem to get it to show unique value counts for each column.
This is my first time attempting to use query, and at first it seemed possible from reading through the documentation on the query language, but I haven't been able to figure it out.
Here's the shared document: https://docs.google.com/spreadsheets/d/15VwsL7uTsORLqBDrnT3VdwAWlXLh-JgoJVbz7wkoMAo/edit?usp=sharing
I know I can do this by writing a custom function in apps script, but I'd like to use the built-in functions if I can for performance reasons (there is going to be a lot of data), and I want quick refresh rates.
try:
=ARRAYFORMULA(IF(B5:5="",,TRANSPOSE(MMULT(TRANSPOSE(N(B6:99<>"")), SIGN(ROW(B6:99))))))
In B3 try
=ArrayFormula(IF(LEN(B5:5), COUNTIF(IF(B6:21<>"", COLUMN(B6:21)), COLUMN(B6:21)),))

Power BI : Add a new value to an existing group

I have a dynamic database (new entries every day), and I grouped values from one column. To group my values, I clicked on the variable I want to group, and picked "New Group".
I grouped my variable such as:
enter image description here
1803 will be added soon, and I'd like to add it to group3, but it does not allow me.
Anyone knows how to do that?
Thanks in advance!
I Don't understand totally the logic for choosing 4 digits of column A to grouped them in G1, G2 or G3.
But, if this depends on the last 2 digits, you can add a calculated column as the following:
Grouped_A = IF(SEARCH("01";'Table'[A];1;0 )>0;"G1";IF(SEARCH("02";'Table'[A];1;0 )>0;"G2";"G3"))
If is not this logic you want to implement, can you explain us better, please!
Hope can help you.