Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
106 views

I've got this query: SELECT TOP (1000) [TRANS_ID] ,[VSN_VENDR_EFF_DT] ,LEAD([VSN_VENDR_EFF_DT], 1, '9999-12-31') OVER (ORDER BY [ACCT_NUM],[VSN_VENDR_EFF_DT]) AS NEXT_EFF_DT ,[...
Johnny Bones's user avatar
  • 8,502
0 votes
2 answers
71 views

I cannot conditionally sum a column where the condition looks at rows further down the table. Below is what I am expecting: Identifier MONTH Sum_Me_Pls On_Off_Flag focus seq Need 1 May-23 0 0 0 1 1 ...
Arch's user avatar
  • 3
0 votes
3 answers
95 views

I've been playing around with dense_rank, LAG, LEAD, ... all kinds of sorting but don't seem able to get this one solved. Here's a sample of my data and the result I expect/need: pk_id pk_id_row_num ...
L.P.'s user avatar
  • 13
0 votes
0 answers
26 views

The "Slider" option is not visible in the question type section while creating an Instant Form on Facebook. enter image description here Based on this article the "Slider" Option ...
Shanker Paudel's user avatar
2 votes
2 answers
98 views

I have the below piece of code in R/Dplyr, which finds the lead value at t+5 for column VALUE. If that is not available, the latest value between t+1 and t+5 is used: data <- data %>% group_by(...
datgoaltho's user avatar
0 votes
0 answers
70 views

I have a Snowflake table with data like below: Table1 Col1 Col2 Col3 G1 1 9:15 G1 1 9:16 G1 2 9:17 G1 1 9:18 G2 1 9:15 G2 2 9:16 I want to ...
Prachi's user avatar
  • 564
0 votes
1 answer
32 views

I would like to identify if a lead being created is yet on the database, base on its email. The following sql query is working in SSMS but not in bql : '''SELECT [CRLead].[ContactID] FROM [dbo].[...
Lionel PARIS's user avatar
-1 votes
1 answer
74 views

I'm trying to put a flag on claims that has an Approved followed by a Terminated on the same date. So in the example below ClaimID = 123 has both an Approved and a Terminated on 12/12/2024 and this ...
jackstraw22's user avatar
0 votes
0 answers
74 views

I want to integrate active prospect's trusted form with meta lead ads to generate a certificate for every lead I get. Now the certificate generation on trusted form is free and the cost incur on ...
Ahsan Ahmad's user avatar
0 votes
0 answers
57 views

In Salesforce, I have set required fields on the Opportunity record and Account record: Account: Billing Address, Type, Website, Number of Employees, Industry Opportunity: TCV, Term, Type, Lead Source,...
Jack's user avatar
  • 1
1 vote
0 answers
60 views

I'm developing an application to capture leads from a Facebook lead form. Here's what I've done so far: I created an App in the Facebook Developer Dashboard. I verified the webhook for this app, and ...
AKSHAY KUMAR KARNWAL's user avatar
0 votes
0 answers
36 views

I have a BigQuery table with the following structure: [ { "case_id": "1234567890", "reply_date": "2024-06-25 13:31:07.000000 UTC", "next_reply_target"...
Mr.Mahajan's user avatar
-3 votes
1 answer
186 views

I have this MySQL table: id Name 1 Spanish 2 French 3 German I am using this statement: SELECT id, Name, Lead(Name) OVER (ORDER BY id) AS 'next' from MyTable WHERE Name='French' The expected result ...
Cymro's user avatar
  • 1,484
0 votes
2 answers
65 views

I need to extract data from a postgres table, where I want to look at nearby records within a 30 seconds of timesstamp with two columns match and fetch the value which is having max value. id | ...
RKIDEV's user avatar
  • 347
2 votes
2 answers
56 views

I have a dataframe that contains promo campaign duration and I need to rid off time-stamp overlapping. import pandas as pd import numpy as np from pandas import Timestamp t1 = np.array([['Store A', ...
Andrew Nikitin's user avatar
1 vote
1 answer
53 views

Sample data: data <- data.frame( year = c(2018, 2018, 2018, 2018, 2018, 2018, 2018, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020), patient_id = ...
Mahm00d27's user avatar
0 votes
0 answers
123 views

I have the following query: select calendar, column1, column2, . . . columnN, count(some_value)/30 as some_value from some_table group by 1,2,...,N Assuming my calendar is a date_trunc on 'month' ...
Konstantinos Vilaras's user avatar
1 vote
1 answer
61 views

I'm working with a dataset in R called "data," originating from data collection on a Fronius inverter. This dataset contains one record per minute and a column named "pac_w," which ...
Carlos Lessa's user avatar
0 votes
2 answers
142 views

I have a dataset for certain STS codes and I need to retain the Start and End Date When Status =03 I have the following Data HAVE ID CHGDATE STS 101 11/21/2022 ...
ckp's user avatar
  • 593
0 votes
2 answers
91 views

I have a basic temp table called #rowCreate with a gap in the count column. It copies an existing table called dbo.rowSource. parentID name count 1 A 1 1 B 2 1 C 5 1 D 6 1 D 8 2 A 3 2 B 4 My goal is ...
Michelle's user avatar
  • 365
1 vote
2 answers
84 views

How do I find the average value of X samples before and after a found event from a sorted table? In the example below, I have sales_list table. I want to sort the table by date and find the events ...
Bensa's user avatar
  • 139
0 votes
0 answers
133 views

I have a form that collects names, emails, and positions. While my PHP code successfully sends the names and emails to Bitrix as new leads, the position data is not being transmitted. <?php ...
Kenan Thompson's user avatar
2 votes
1 answer
740 views

I was testing and comparing various forms of the LAST(), LEAD(), FIRST_VALUE() and LAST_VALUE() window functions and appear to have found a bug with LEAD() IGNORE NULLS. Instead of the expected ...
T N's user avatar
  • 10.6k
0 votes
1 answer
42 views

I have a database that records user access. User access is requested and users are given a two hour window to access their space. At the moment, users can request multiple requests, which sometimes ...
ME_2023's user avatar
1 vote
2 answers
87 views

I have a list of timestamps for data acquisition. timestamps close together belong to a cycle. I want to enumerate these cycles. So whenever between two timestamps is more then 100 seconds then it ...
aludebe's user avatar
  • 23
2 votes
3 answers
86 views

Here is my data: structure(list(date = structure(c(19662, 19663, 19664, 19665, 19666), class = "Date"), tmax = c(12, 13, 12, 11, 15)), class = "data.frame", row.names = c(NA, -5L)...
piblo95's user avatar
  • 357
0 votes
4 answers
77 views

I have a table with two columns. First one is an autoincrement ID column, second one is a datetime column where next data should be in future to the previous. I need to select values where it is not ...
Іван Крічфолуші's user avatar
-1 votes
1 answer
387 views

This works with SELECT: (LEAD(AltCode,2) OVER (ORDER BY AltCode) ) from [clroot].[Material] but not with Update USE [MEKON-EPE] UPDATE [clroot].Material SET String1 = (LEAD(AltCode, 2) OVER (ORDER ...
D.j. Black's user avatar
-1 votes
1 answer
440 views

I am creating a formula field on Lead object. If country of lead is one of the field from picklist value of high risk countries picklist field then show some image and text which i have stored in ...
Pooh's user avatar
  • 17
0 votes
1 answer
40 views

How would one keep the corresponding two rows (all columns preserved) that produced the max difference after grouping, arranging, and subtracting the 4th lead from the current value? I can currently ...
user11057680's user avatar
0 votes
1 answer
736 views

I have a large dataset and want to retrieve previous and subsequent observations for small windows. Below is a snippet around a window of interest (2024-09-23 to 2024-09-27). item date price A ...
Misha's user avatar
  • 169
0 votes
1 answer
105 views

I'm trying to get an entry from a table that has START_TIME and FINISH_TIME. If FINISH_TIME is null then have to get the next START_TIME. Below is the query I tried, also have to use the lead function ...
Vasanth's user avatar
  • 25
0 votes
2 answers
61 views

I have a table like ID TYPE START END TIMESTAMP_ 1 A NULL 5 '2022-03-03' 1 B NULL 7 '2023-07-19' 1 A 5 NULL '2023-07-20' 1 B NULL 7 '2023-07-21' 4 A NULL 20 '2023-06-30' 4 A 20 17 '2023-07-01' I am ...
Anonymous's user avatar
1 vote
1 answer
191 views

I am looking to do LEAD() and LAG() functions to perform in DataStage. Input C1 C2 1 100 2 200 3 300 4 400 Output - 1 C1 C2 C3 1 100 200 2 200 300 3 300 400 4 400 NULL Output - 2 C1 C2 C3 1 100 ...
Hell Watcher's user avatar
0 votes
2 answers
135 views

I have a dataset with conversation data between a User and a Customer Service. I need to find the response time (time difference) between after a user sent a message and first time the Customer ...
KaraiKare's user avatar
  • 169
0 votes
1 answer
164 views

I have a set of data containing invoice information. The goal is to find the credit and rebill invoice number ('InvcNbrKey') associated with a particular 'Standard Order' line. Think of it as a person ...
T340B's user avatar
  • 55
-2 votes
1 answer
83 views

I'm using the Superstore_test dataset here: https://www.kaggle.com/blurredmachine/superstore-time-series-dataset I want to make a column that shows the sales of the next row down. I put this query in ...
Tynan's user avatar
  • 9
0 votes
1 answer
107 views

Is there a way to assign unique Group ID to rows in SQL based off on how much time is between each one (in this case 60 minutes). For patient 614 I would like to start the first row at 12:50pm and ...
ThisGuyLA13's user avatar
-2 votes
2 answers
43 views

I want to get the count of 'unitsold' for each Name from 3/1/2022 and 4/1/2022. For example Name 'a' required to count its units sold from 3rd to 8th day. SQL query: select Name, sum(unitsold) over (...
Sanky Ach's user avatar
  • 335
0 votes
3 answers
137 views

Requirement is to pick the next change date from the following table as RetailDate Brand IdBusinessUnit 2023-02-05 B Series 2 2023-02-07 B Series 2 2023-02-07 Equity 2 2023-02-15 Equity 2 2023-02-21 ...
Karunakar Reddy's user avatar
0 votes
0 answers
25 views

I am having a Table contain two columns named Time_stamp and PWPH_Pmp_2_FBSts and table name is per_hour_log The Sample of A Screen Shot I embedded for the reference.The Query Which I Wrote is as ...
LALIT ACHAREKAR's user avatar
0 votes
2 answers
3k views

In this sample table fruits, I want to get previous row, current row and next row where high_low_adjstmnt < 0. Table id name low high high_low_adjstmnt volume 1 Apple 5 3 ...
Shawn Chowdhury's user avatar
-1 votes
1 answer
143 views

I have records like below: login_id login_type login_name login_timestamp page_id 1 event null 2023-01-13 00:22:02.560 1 1 event null 2023-01-13 00:22:02.634 1 1 page login 2023-01-13 00:22:02.882 1 1 ...
VarYaz's user avatar
  • 151
1 vote
1 answer
86 views

I have a table like this, and there are three cases, ## case a | rec_no | read_time | id +--------+---------------------+---- | 45139 | 2023-02-07 17:00:00 | a | 45140 | 2023-02-07 17:15:...
hong's user avatar
  • 13
0 votes
1 answer
39 views

I need for each group of ID's to find the last (lag) of another column, but not just the last, but the last matching the condition. My problem is, I don't know how to add the condition to the row. My ...
Louise Sørensen's user avatar
0 votes
1 answer
232 views

I am trying to calculate percentage change between elements in a vector of a dataframe: Year Year Count 2010 55302 2011 58943 2012 59633 2013 50194 But I the new column I create is only giving NA ...
MSMagona's user avatar
1 vote
2 answers
2k views

I'm trying to write a query that will show me the difference between the current value and the previous one from the query result. It seems to me that this can be done with the "OFFSET" or &...
piolvi's user avatar
  • 25
0 votes
1 answer
228 views

I have this example dataframe in R. id <- c(1001, 1001, 1002) status <- c("dog", "cat", "mouse") col3 <- c(5, 8, 4) col4 <- c(9, 9, 6) df <- data.frame(id, ...
Zipsa's user avatar
  • 77
0 votes
0 answers
37 views

Given a simple table of data for Postgres version 14 and higher: item_id p_date low_price A1 2022-11-01 5.00 A1 2022-11-02 5.10 A1 2022-11-04 5.20 A1 2022-11-06 5.30 A1 2022-11-08 4.99 A1 2022-...
SuperDave's user avatar
  • 413
-1 votes
3 answers
2k views

I have a table that records user transactions like this (simplified version) in BigQuery user transaction_date label cost a 2021-10-31 10:30:00 y1 10 b 2021-10-31 10:30:00 y2 10 c 2021-10-31 10:30:00 ...
shinjitos's user avatar

1
2 3 4 5
7