659 questions
1
vote
1
answer
106
views
Combining Two Dataframes Based on Multiple Conditions & Removing Rows that Don't Match
I need to combine two dataframes: one with detection data and another with the metadata for those detections.
The column names of the first dataframe, which is called rt_det are:
tag_id, power, ...
1
vote
1
answer
77
views
Issue with expression using IIF with multiple parameters
I am trying to create an expression with an IIF statement:
1st condition that takes a parameter minus 1 = field1
2nd condition takes another parameter = 'field2
true
false
I have tried to use switch, ...
2
votes
2
answers
99
views
Using ActiveX Checkboxes Conditions to Check or Disable Another Checkbox AND to Populate Column
Fair warning I'm very new to using VBA and I've looked all over this site but I can't seem to a similar question.
I'm hoping it's a pretty easy solution though.
I have these checkboxes 1 - 4
Example ...
0
votes
2
answers
69
views
Can't manage to make multiple averages with SQL [duplicate]
I've been trying to see the average salary of each profession of a hospital (this is an exercise BTW) but I can't manage to make an average for each service separately.
My last and what I believe is ...
0
votes
1
answer
30
views
DAX How to Return Value Based on Business Logic
I have a data set that is pulled together from different sources, but on one table. I need a formula that will help me evaluate and choose the correct column.
3 Text Columns
USI
4Ever_Code
Kit_Code
...
0
votes
2
answers
53
views
Multiple conditions in Excel
I'm working on an Excel project and I need to assign scores to athletes based on their time and gender. I don't have a helper table, and I want to do this using a formula that takes both gender and ...
0
votes
1
answer
69
views
QUERY function with multiple conditions using time frame
I have this query that I am trying to add a condition to to filter out the results of a report given a time frame (time frame in my sheet is N2 and N3)
What I have now is the following and it works ...
0
votes
0
answers
108
views
Compare 5 columns with another sheet
I am trying to compare Sheet 1 row E to I and see if at any of these values matches the corresponding column C to G in sheet 2. Both sheets have the same header. If any of cells matches in sheet 2 on ...
1
vote
2
answers
234
views
Excel Sumproduct with multiple criteria lookup in two tables
For a report, I need to calculate the SUMPRODUCT() of amounts in a data table multiplied by a factor value determined using a lookup table, the factor value (and thus column) to use depends on ...
1
vote
1
answer
46
views
Calculate a score depending on multiple conditions in R
I'm dealing with a dataframe showing answers to a questionnaire by several participants. A certain question can have many correct answers and the data look like this:
a <- c(0, 0, 1, 0, 1)
b <- ...
0
votes
3
answers
80
views
If ... else : the condition has length > 1
I am trying to classify variants according to their type (polymorphisms, insertion or deletion). Here is a snippet of my input :
A T
G C
T AG
C T
TT C
AT CC
Here is the dput output, if you need ...
0
votes
1
answer
58
views
Multiple OR conditions in an AND formula
I'm trying to get a yes or no result from comparing certain items that could be the content of a cell (F2) with certain possibilities from (H2) and again from (K2).
If all the conditions are true then ...
0
votes
1
answer
66
views
Replicating IF ANY conditional logic or a SUMIF Equivalent in PeopleSoft Query
Setting up an expression with conditional logic to determine the type of requisition within our business logic. Some requisitions can have multiple REQ_LINE.LN_TYPE (e.g. Req Line 1 = CAT & Req ...
1
vote
3
answers
253
views
Case sensitive distinct count from one column based on cell values in another column in EXCEL
Can you please help me with finding the count of distinct (case sensitive) products sold (Column B) per store (Column C) as per below data? Product_sold column has data from B2: B10. Store column has ...
0
votes
1
answer
128
views
Crystal Report If formula with multiple conditions
I'm getting an error message with this formula but can't see the wood for the trees of what's missing - please help!
if {vehinv_rec.master_class_2} = "RCV" and if {vehinv_rec.chassis_model} ...
0
votes
0
answers
44
views
Calculating emission values based on min or max of a certain column for specific reporting time
I am a SQL beginner and self learner working on improving my SQL fundamentals. I am trying to use retrieve the min and max Entry_ID to calculate emission values based on certain dates.
I have 2 tables ...
0
votes
1
answer
98
views
SAS Macro Proc SQL w/ Multiple Conditions
I'm trying to run a proc sql macro that contains multiple conditions strung together. Is there a way to correct the code below for the 2nd macro (rn_cnt) or is there a better approach? Background: ...
0
votes
3
answers
176
views
Look up but for columns not rows
I want to fill the price column in sheet 1 based on two criteria
first criteria is a code which i will use xlookup to find the respective row in the table in sheet 2
the second criteria is the one in ...
0
votes
1
answer
84
views
Join two tables in SQL with date condition
In the first table, I have client number, start date and other columns:
Client number
start date
other1
other2
xyz
2024-04-01
values10
values20
abc
2024-01-02
values11
values21
ert
2024-01-03
values12
...
1
vote
1
answer
66
views
Creating a new flag based on multiple conditions on SAS
I'm struggling to find out how to create a flag. My data set looks like this:
CPT PRODUCT DATE A B C D etc.
1 A date1 . ...
0
votes
0
answers
42
views
create random sample conditionally using a file
I am trying to assign reviewers to projects with the condition that the author of the project cannot be assigned as a reviewer to a project in their own portfolio.
I created a dataset with variables ...
0
votes
1
answer
40
views
How do I do right join with multiple conditions?
I have an example below where I need to perform a right join with multiple conditions:
1st dataframe:
df_1 <- data_frame(
dates = c(as.Date("2023-03-01"), as.Date("2023-03-05")...
1
vote
1
answer
93
views
VBA For loops multiple conditions
The task of this For loop would be to collect data from the two worksheets and use it in a user form. In the first part, the data should be copied if the EmplID and today's date match. If this ...
-2
votes
1
answer
204
views
conditional on multiple conditions in power bi
I'm trying to create a conditional that is based on two columns. The first condition is based on a city, let's say it needs to match the value "Texas" and the second condition is a range of ...
1
vote
2
answers
72
views
Replace specific levels of a row with NA, based on conditions across ALL factor columns of a data frame
I have a large data frame, df_f, with different levels across multiple column (5 columns in this example):
c1 <- as.factor(c("NA", "1.1_mif", "NA", "NA", &...
0
votes
2
answers
57
views
How to find out if a variable is an even number, but not zero?
I am not sure how to check if a variable is an even number, but more than zero. Is it possible to put 2 conditions for one statement? Is the following wrong?
> if (i %% 2 == 0 & i > 0){
...
-1
votes
1
answer
81
views
How to count occurrences across rows within the same column by multiple conditions
I have the following dataset on R:
patent_id
CPC
xxxxxx
Y02P
xxxxxx
H01M
xxxxxx
GO1H
xxxxxx
AO2A
yyyyyy
A01B
yyyyyy
Y02E
yyyyyy
Y02T
yyyyyy
Y04S
For each CPC equal to CPC-Y02 (Y02A, Y02B, Y02C, Y02D, ...
1
vote
1
answer
55
views
Daily production sheet and Attendance sheet integration
I have 3 sheets. The first sheet is named ACTUAL HRS. It has a table that starts from A to F.
Column A is the User ID and Columns C1, D1, and E1 are headers for dates from Nov 01 to Nov 04. The values ...
3
votes
1
answer
86
views
Mutate across with 2 conditions, one on variable name and the second on variable type
Let say I have the following table:
df <- data.frame(
a1 = 1:5,
b1 = as.character(1:5),
c = 1:5
)
> df
a1 b1 c
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
5 5 5 5
I would like to ...
1
vote
2
answers
85
views
Groupby with multiple conditions and count
Hi would be great to get some help on this for Python Pandas.TIA
I have a dataframe which has 1M rows with below columns:
PID
lurn_fls
locality
Comparision
ACT933
2
Kambah
mbn:match both non-empty
...
0
votes
1
answer
135
views
How do I copy certain cells from one sheet to another conditional on the cell value in both sheets?
I have a range of non-contiguous cells that I want to copy across from one sheet (wseDNA1) to a second sheet (wsElog1). I only want to copy if the value in wseDNA1 is not "NR", and if the ...
-2
votes
3
answers
464
views
SQL left join with n conditions
Hi i got this database with cars and every car has options
I got a cars table and a options table. Link one to many, a car has n options a option has exactly one car.
I use the database to filter for ...
0
votes
1
answer
894
views
Multiple IFS FUNCTION in Google Sheet
sample data
https://docs.google.com/spreadsheets/d/1Asd_7njduyx4ku9ZzqqBLmbLxXuZ2RBNlZvCQx12bFk/edit?usp=sharing
Referring to above sample data pictures & link, I need help make formula in Column ...
0
votes
3
answers
228
views
How to write SQL query with multiple conditions using CASE function
The table
The task is:
Count the number of customers who simultaneously:
have more than 5 payments that exeed 5000 dollars
and have an average payment value of more than 10,000 dollars
I have done ...
0
votes
1
answer
375
views
Two condition true in specific period
I want to write an indicator on tradingview solve one pine script problem. I have three indicators (for example MACD, EMA14 and volume) and I want to check these indicators for specific period. If in ...
-1
votes
1
answer
15
views
having hard time with writing this code: need a while function
loop to input sales for multiple emplyees, nested for loops to input the sales each week for monthly total. total sales and emplyee count are accumulated for the month and checked against sales goal. ...
1
vote
1
answer
707
views
Power Query Editor - Edit multiple columns with different values based on multiple conditions
I am using Power Query Editor and need to change several columns based on a several conditions.
At the moment I am doing this in 3 separate steps using Table.ReplaceValue, but with each iterative ...
1
vote
2
answers
43
views
Pandas replace the value of a column based on the value of the same column in another row
I am trying to replace the values of a dataframe column with the value of the same column but from another row.
The ID of the COUNTRY with type "TO_REPLACE" must be replaced by the ID of the ...
0
votes
2
answers
310
views
Mutate in place and if_any with condition over multiple columns
I am using R dplyr and trying to mutate multiple columns in place. These columns are var1-var3, and they currently contain values of either 1 or NA.
I want to apply the following logic: if a given row ...
1
vote
1
answer
225
views
Java conditions execution in sequence
Is there a better way writing this logic.requirement is to apply sequence of conditions in the specific order. It’s a fall through conditional logic, assume it’s like a funnel. It has to go and ...
0
votes
1
answer
223
views
MongoDB - How to query with multiple AND conditions for phone numbers using FilterDefinition
I have a MongoDB collection named "Applicants" with documents containing information about applicants, including their last name, type, and an array of phone numbers with different types ...
0
votes
1
answer
938
views
ADF: Derived column with multiple (true) conditions returning string array
I have the following problem in a Data Factory data flow:
I have two pipelines that extract data: one daily on weekdays, and one monthly on the first working day of each month.
In the data flow I ...
1
vote
1
answer
121
views
Group by id and look at previous row value to determine next row value based on multiple conditions
I hope someone can help me out with this! I haven't found anything online that comes close enough.
Sample data:
import pandas as pd
sample_data = {
'id': [1,1,1,1,1,2,2,2,2,2],
'date_rank': [1,2,3,4,...
0
votes
2
answers
2k
views
Multiple Conditions in if statement in both "OR" and "AND" operation in C++
I'm a bit confused with "or" and "and" operations inside "if" statements.
Here, if(condition_1 || condition_2) in this operation, when the OR operator checks both of the ...
2
votes
2
answers
63
views
Python: How to sort strings (filenames) by multiple conditions?
I have a problem with sorting my strings which are stored in a list. The string is actually a path/filename of a measurement and looks e.g. like this:
'Data\Test1\Test1_<...
0
votes
0
answers
48
views
How can I use AND function only for specific text in a column with unknown number of cells?
I try to create a formula in another sheet that verify for the first sheet if all the following conditions are true: In Column A ="User 1", column C starts with "01" and for Column ...
3
votes
1
answer
148
views
Finding unique combinations that fulfill a given set of conditions
I'm trying to find the unique combinations that fulfill the given criteria, sorted by cost.
An example:
Criteria: [A, B, C, D]
Entities: [
E1 = (costs = 5, covers = [A, B, E]),
E2 = (costs = 5, ...
0
votes
1
answer
182
views
Filter rows from specific columns based on two conditions with dplyr
I hava a dataframe (df) with 16 numeric columns. Its rownames are gene IDs.
Something like this:
colnames (df)
[1] "pval_hr6_vs_0" "ratio_hr6_vs_0" "...
0
votes
1
answer
71
views
If with two conditions based on two cells
I need to add a second condition to my code.
If Len = 3 and UPC is blank, then move the Group Code left 1 column.
I've the action part resolved. The second condition has me stumped.
I tried And in the ...
0
votes
1
answer
710
views
Simulink if-else block retains last value instead of switching back to 0
First let me explain this system: this is one of a couple of states all based on 3 inputs. None work at the moment so I took this one apart to test it. This state is true if u1>0 & u2>20 &...