Questions tagged [calculated-columns]

A calculated column is calculated from an expression that can use other columns in the same table

A calculated column is calculated from an expression that can use other columns in the same table. The expression can be a noncomputed column name, constant, function, and any combination of these connected by one or more operators. The expression cannot be a subquery.

2235 questions
0
votes
2 answers

Pandas - make new column with mean values of the part of another column

I have a big Data Frame with full datetime as index and 2 columns with temperature in every minute (I don't know how to write code with dataframe with time index, sorry): df = pd.DataFrame(np.array([[210, 211], [212, 215], [212, 215], [214, 214]]), …
0
votes
1 answer

How to make a divide in lookup and got error in Mongodb

I'm new to MongoDB and it's really hard to do divide with lookup. I want to make a monthly salary for each employee. How can I do that? Thanks in advance. Any help would be greatly appreciated. Also, I converted my salary field to float. However,…
rra
  • 809
  • 1
  • 8
  • 20
0
votes
1 answer

Can't calculate the sum of table rows I've tried many ways from the internet but nothing

I want to build tables that fetch data from api and I succeeded in that so I need now to calculate numbers of table rows and show total in next row or in span div it does not matter. I just need total as shown in image.. I already tried many…
0
votes
1 answer

Spotfire - Calculated column based on values in another column in Spotfire

I just started using Spotfire and I am having a bit of a tough time figuring out how to create a particular calculated column, I need your help please. Here's a sample of the data I'm working with and the calculated column (NewCol) with the results…
0
votes
1 answer

Entity Framework persisted computed column woes

I recently updated a computed column to be persisted due to poor performance when querying it. However now updates to child records throw this error System.Data.SqlClient.SqlException Internal Query Processor Error: The query processor could not…
0
votes
1 answer

Using SQL String_AGG for Computed Column

I'm trying to figure out the best way to address this scenario and eliminate the duplication of data. I have two tables: Product and Attribute. (SQL Server Express Edition (14.0.3281.6), SSMS v18.4, running on Windows Server 2019 Datacenter hosted…
GJGerson
  • 211
  • 1
  • 9
  • 20
0
votes
1 answer

Create a column B that stores the sum of a group in a column A but only at a specific value

I have a dataframe (below) where I read in time series data of when lights were turned and left on and then turned off. I created a series of calculated columns in my dataframe to identify each cluster (continuous "On" clusters). What I could like…
NightLearner
  • 295
  • 1
  • 7
  • 21
0
votes
2 answers

Get multiple columns for different WHERE clause on the same column in SQL

I have a table and column containing date (say in string). I need to get two columns such as countin(2020) and countin(2019) from the same date column such that date is like '2020%' or '2019%' and I want them as separate columns. My query is kind of…
0
votes
1 answer

Identify the first occurrence of a record by monthly basis calculated column

I have a requirement, where i need to create a calculated column and to identify the first occurrence of a record by monthly basis. Below is the sample data. The data has duplicates values o a monthly basis. ID MONTH AA Jan-01 AA Jan-02 BB …
Prem Chand
  • 126
  • 1
  • 10
0
votes
1 answer

Streamlining T-SQL user function for persisted computed column

I am trying to streamline the following T-SQL user function to be used within a persisted computed column in one of my table. I understand that I can use a calculated column within a view among other methods but for various reasons due to user…
0
votes
1 answer

How to get rid of 100% calculations in PowerBI

I am trying to display on time performance as a percentage using a calculated column in PowerBI but when I filter the dates on my dashboard, all months or weeks outside of the filter display as 100% rather than disappearing like all other visuals on…
Albert
  • 3
  • 1
0
votes
0 answers

How do I make a calculation field reference specific values from a pivot table in google sheets

So I'm making a punch in/out dashboard in google sheets. It uses a google form to populate a sheet with my employees punches like so: Timestamp | Name | Punch Type | Time 6/2/2020 15:09:55 | Bob | 1. Start Shift |…
0
votes
0 answers

How can I count values of a column in a pandas data frame and store the count for each value in new column of that data frame?

I have a pandas data frame with numbers looking like this: a b c 0 2 3 1 1 1 2 2 2 1 3 2 3 2 4 1 4 2 4 1 5 1 1 3 I want to count each unique value in column "b" and add…
Sebastian
  • 7
  • 1
  • 6
0
votes
1 answer

calculating percent change month over month in SQL

i want to query one table to find the sum of charges for a good within the months of Jan - May of 2018 - 2019. i know how to conditionally sum to get the charges broken out by year, but i'm unsure how to also build out a subquery to calculate the…
mpc83
  • 83
  • 7
0
votes
1 answer

How to create a calculated column in access 2013 to detect duplicates

I'm recreating a tool I made in Excel as it's getting bigger and performance is getting out of hand. The issue is that I only have MS Access 2013 on my work laptop and I'm fairly new to the Expression Builder in Access 2013, which has a very limited…