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

Read x,y from file columns, convert to r, θ and save in different columns same file

I have a file with 17294 particles and for each particle I have x,y,z in three 3 columns (x,y,z). Z=0 for every particle so the problem is 2-D. I want to convert the Cartesian coordinates to polar and save them in the same file (4th column for r and…
0
votes
2 answers

Add a derived attribute to existing table in SQL Developer

Is there any way to add a derived date/time column (to an existing table) to hold calculated running time from a race. The values are in hours, round to 2 decimals. There are 2 columns for start time and end time in the table. Below is the last…
RyanY
  • 1
  • 1
0
votes
3 answers

How to fix spelling error in a field or column value using Tableau

There is a column whose values of form CodeXX has been misspelled as Code-XX in some of the records/rows. I want to merge all Code-XX to CodeXX while doing aggregation operation in Tableau. How can I merge the misspelled data value with the…
Saurav Sahu
  • 13,038
  • 6
  • 64
  • 79
0
votes
0 answers

How to (efficiently) calculate results with the Poisson distribution based on input values from two columns using R?

I've used Excel in the past to calculate my results using the poisson function but it took too long so I decided to switch to a more efficient application/language. I've tried SQL (recognised that it might not be an ideal solution for statistical…
blowbuh
  • 37
  • 6
0
votes
1 answer

Precision of decimal computed columns in T-SQL

We used to have the following field in database: FieldA decimal(19, 2) We have changed the field to a computed field: ALTER TABLE MyTable ADD FieldA AS FieldB * FieldC Where: FieldB decimal(19, 2) FieldC decimal(19, 5) The resulting new…
masa
  • 2,762
  • 3
  • 21
  • 32
0
votes
0 answers

populate new columns using formulas of previous column

I have a data frame of 2 columns (stage, year2000) and 6 rows as shown. stage (A,B,C,D,E,F), year2000 (100, 120, 90, 80, 70, NA) I added a new column "year2001" using the R codes below: data$year2001 <- ifelse(data$stage=="A", data$year2000*0.1, …
Almond
  • 87
  • 1
  • 1
  • 5
0
votes
1 answer

Calculated MySQL column using variable not returning right result

I'm trying to use defined variables to calculate a column but the result does not add up correctly. I've tried moving the variable declaration inside the brackets or playing around with the aggregation but the calculated column (Profit in the…
0
votes
1 answer

Why is the Data in my Computed Columns showing up with null / 0 values

I need to create a query that shows the average productivity for editors that have worked on more than one book except for their first book published with a precision of 0.01 pages/day. I have the correct columns showing now but the computed column…
YHapticY
  • 177
  • 11
0
votes
1 answer

Spotfire: Grouping rows in a table by columns

I have three calculated columns in my table. How do I group the data so that I have one row per Department that shows the Head of Department and the values of the three calculated columns. I made a mock dataset seen here Data Before And here is what…
0
votes
1 answer

How to write calculated fields to evaluate variable row sums in Tableau?

I had posted the question in Tableau community, but did not get a solution there for 20 days now. Hence posting it here (the Excel sheet containing the data as well as the desired output, and the Tableau workbook are attached in the post in the…
Kristada673
  • 3,512
  • 6
  • 39
  • 93
0
votes
1 answer

Computed boolean column while creating table

I'm trying to create table with computed boolean values CREATE TABLE parts ( Id SERIAL PRIMARY KEY, Weight INTEGER NOT NULL CHECK(Weight > 0), Color VARCHAR(10), Price INTEGER NOT NULL CHECK(Price > 0), IsCheap BOOL AS (CASE WHEN…
0
votes
1 answer

I am facing an issue while adding calculated field through Apache POI

I am trying to add calculated field through Apache POI and I am facing issue when there is only one non-calculated field and rest others are calculated fields I am getting an error while opening excel sheet as below Error Image But when there are…
0
votes
1 answer

Spotfire: Calculating the Date Differences between Values in the Same Column which are Group by another Column

I am a beginner in Spotfire. I made a sample table which can be seen below. This is what I am trying to accomplish: for each TYPE I want to calculate the difference in days between ACTIVITY 1 START and ACTIVITY 3 FINISH. I was trying to utilize the…
0
votes
3 answers

Adding a calculated field to convert string value to date in T-SQL

I'm trying to add a calculated field to an existing table in SSMS, which will convert a string in the format YYYYMMDD to a date format, but I am getting errors regarding the string field not being valid. I require the calculated field as I have…
chatters
  • 11
  • 3
0
votes
3 answers

ISBLANK() or LEN() not working while checking Calculated Column which returns Date by formula for SharePoint List

Three choice fields 1st route, 2nd route, 3rd route all containing text. And 1st route, 2nd route, 3rd route columns have values like: Now I have three more columns: 1) Current Route (Calculated column checks above given choice columns and returns…