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
1 answer

Mean number of kids by mom's age?

So I have this DF showing moms' ages & the b3_01-b3_10 columns correspond to the kids birthdates (converted to something called the "century month code" - not important here). Anyways, I'm trying to calculate the mean number of kids by mom's age.…
Anna Bokun
  • 55
  • 7
0
votes
2 answers

Dataframe column status

On the column for status I want set status as 1 if diff is less than 0 and 1 if is more than 1.
Kgabo
  • 1
0
votes
2 answers

Sharepoint Calculated Column based on creation before or after 15th day of month

I have worked though this in a few different ways and had little luck identifying where i'm being a bone head. Here is what I have. SharePoint List with column Date_received data type is date Same list has column named storage Data type is…
PCGIZMO
  • 63
  • 2
  • 3
  • 12
0
votes
1 answer

Can't compute an aggregation of an aggregation in Tableau

I'm trying to compute the standard deviation of a nested calculated measure. In this example, different countries produce a number of items every month, each with a specific colour. I'm trying to sort countries by the standard deviation of the…
Jivan
  • 21,522
  • 15
  • 80
  • 131
0
votes
2 answers

Random value in computed columns

I have the following script that creates a table: CREATE TABLE [dbo].[Persons] ( [Id] INT IDENTITY(1,1) NOT NULL, [Name] NVARCHAR(250) NOT NULL, [Surname] NVARCHAR(250) NOT NULL, [NumberOfNotes] INT…
Tarta
  • 1,729
  • 1
  • 29
  • 63
0
votes
0 answers

Filter function in DAX

I hope someone can help me. I'm struggling with a DAX related question. I want to add a calculated column to index my cashflow with the index % from previous years. I have a many-to-one relation. One table with containing cashflows in different…
Francesco
  • 5
  • 2
0
votes
1 answer

Show values in Matlab depending on previous values in another column

I'm struggling with the following problem in Matlab: I’ve got a table containing a few column vectors: Day, Name, Result My goal is to create another column vector (New vector) that shows me in each row the result of the previous day for the…
blowbuh
  • 37
  • 6
0
votes
0 answers

T-SQL: How to set a calculated column value by specific filter criteria?

I apologize in advance for formatting within this post. I am new to posting on Stack Exchange and still finding my way around. I have a query returning a data set which is ranking customers by sales qty & dollar amount. The rank number is being…
Shae
  • 1
  • 2
0
votes
2 answers

Create a column that answers if a cell in one column is located in either of 4 other columns

I want to create a column that answers if string values from column 'A' are in either column 'B' or 'C'. These can be converted to float or int if that makes it easier. Data: A B C OUTPUT A B C No/False B B B …
0
votes
0 answers

SQL syntax question for creating a calculated column

I thought below would work: strSQL = "ALTER TABLE table1 ADD COLUMN weighted_score AS (IS NOT NULL(score='H')*2 + IS NOT NULL(score='L')*1 ) but I get "Syntax error in field definition" 3292
0
votes
1 answer

Calculate and add columns to a data frame using multiple columns for sorting

I have a pretty simple data frame with Columns A, B, C and I am would like to add several. I would like to create two cumulative summed columns and have these stored in that same data frame. Currently I'm doing it by creating two different data…
NightLearner
  • 295
  • 1
  • 7
  • 21
0
votes
1 answer

Power BI - DistinctCount with conditions does not working

I have a table and I need to add the different values that are greater than 5 and belong to the DEV team. Unfortunately, it is not working. I used this code, the expected result is 6 but now is showing only 3. CALCULATE( DISTINCTCOUNT('data…
0
votes
1 answer

Modify values within a column and row (PSQL)

I get the following error for this query: [22P02] ERROR: invalid input syntax for type numeric: "." select date, row_number () over () as RN, case when (row_number() over ()) ='8' then '.' else (success/trials) end as "After_1M" from trials groupy…
ColRow
  • 59
  • 3
  • 8
0
votes
2 answers

Computed columns or store

I need a couple of computed columns that contain count totals (indexed columns). Do you think it is better to use a computed column in a view or add extra columns to the table that will store the totals? Adding extra columns would probably mean…
user666423
  • 229
  • 3
  • 14
0
votes
1 answer

Problem adding a column for each dataframe in a list

Python, Spyder Hello I have a folder with 1440 files that each represent a time stamp of a day and the filename has that timestamp. In the following code, i have made a dataframe list of all these files. For each dataframe I need a column with the…
nielsen
  • 383
  • 1
  • 6