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

R: Summing values of columns through a loop

I'm really new to R and this forum, and need help constructing a loop. (I'm a biology student with almost zero programming experience). My dataframe has the following (simplified) structure: a = "TNS" b = NA c = NA d = 21 e = 37 …
3
votes
1 answer

How to calculate the daily cost based on total hours?

How to calculate the cost using SQL what i want is to calculate cost for a single CCODE. In this data table the cost is belong to the day (DayUID) not a particular CCODE but we can extract that for particular CCODE base on the hours of the CCODE.…
3
votes
1 answer

Hibernate @Formula results in org.hibernate.HibernateException: Missing column

I've got following entity with calculated field isIdle: @Entity @Table(name = Customer.TABLE) public class Customer { // ... @JsonIgnore private static final String IS_IDLE_SQL = "CASE WHEN (trunc(extract(epoch from now())) -…
Mikhail Batcer
  • 1,938
  • 7
  • 37
  • 57
3
votes
2 answers

update computed column in nhibernate code first

I'm using nhibernate code first And I have a computed column. [DatabaseGenerated(DatabaseGeneratedOption.Computed)] public virtual bool? IsInternal { get; set; } when I'm trying update my object, I received an error: The column "IsInternal" cannot…
Fereshteh Rabet
  • 191
  • 2
  • 18
3
votes
3 answers

rowMeans if column name is number

I have datafram that looks like: Data i have looks like.. Tester Type Subject Type Time 1 2 3 TType1 SType1 Day 1 11 2 1 TType1 SType2 Day 1 3 2 13 TType1…
Bryan Han
  • 67
  • 6
3
votes
2 answers

NHibernate: Conditionally load a calculated column

I have the following proprty This loads the amount of a Transaction that has been allocated to…
Alistair
  • 1,939
  • 2
  • 22
  • 31
3
votes
2 answers

Sqlite add column based on another columns value

I have a first_name field in an SQLite database. I want to alter this database by adding a first_initial column and make its value the first character of first_name followed by a period. How do would I go about setting the value of first_initial,…
Sam Luther
  • 1,170
  • 3
  • 18
  • 38
3
votes
1 answer

Scalar function as a part of computed column

I am using SQL Server 2012. I want to create a table with a computed column. This column is a sum of columns in this table, but I need to multiply the sum by a VAT rate from VAT table to get a gross value including the tax. VAT values are inserted…
kkris77
  • 117
  • 4
  • 15
3
votes
2 answers

How to get total of multiple columns from sum of quantity and average of price?

I am working on an Ms Access Database and there is a table called "Data Table" and the data this table contains is sold stock of a business and the columns are Item, Quantity, Price, Total and I used the following aggregate functions for grouping…
MNR
  • 727
  • 1
  • 9
  • 23
3
votes
4 answers

Simple Enquiry with Complex Answer - How do I Select RowA6-Row(last non-blank) for a simple formula

I have many columns all labeled with many many values underneath, which can be words or numbers Here is the current equation =INDEX(AK6:AK94,MODE(MATCH(AK6:AK94,AK6:AK94,0))) I have this on the in cell 5 of each column. The number of values in each…
Coding Novice
  • 437
  • 2
  • 8
  • 22
3
votes
1 answer

Syntax error in SharePoint calculated column formula

Is it possible to debug SharePoint calculated column formulas? I am trying with a really simple SharePoint calculated formula =IF([YTD]<[Budget], "OK", "Not OK"). This being a Danish installations of SharePoint I believe the fomula should look like…
Jan Aagaard
  • 10,940
  • 8
  • 45
  • 80
3
votes
3 answers

Converting Julian Date (5 or 4 character) to Gregorian and vice versa

I'm trying to create a VBA script or a formula/function that converts a Julian Date (5001 or 15001) to a regular date (01/01/2015). I was able to find the following formula that converts a 5 character Julian Date to Gregorian Date and it works…
flwr_pwr
  • 150
  • 4
  • 16
3
votes
2 answers

How to find the number of columns in a tab separated file

I have a tab separated file with 1 billion lines of these(imagine 200+ columns instead of 3): abc -0.123 0.6524 0.325 foo -0.9808 0.874 -0.2341 bar 0.23123 -0.123124 -0.1232 If the number of columns are unknown, how do I find the number of…
alvas
  • 115,346
  • 109
  • 446
  • 738
3
votes
1 answer

convert columns to rows sql server

these are my data: and I want to have this result: Please note that the values inserted into column "App", haven't got the same value or the same quantity, so once I could find 2 rows and another time 10 rows
img.simone
  • 632
  • 6
  • 10
  • 23
3
votes
1 answer

Google Spreadsheet: vector-like operations on columns

Imagine two columns A,B in Google Spreadsheet like A B 1 1.0 1 2 1.5 1 3 3.0 2 4 2.0 1 5 2.5 2 With the function =SUMPRODUCT(A1:A5;B1:B5) I would get 15.5 by summing up the products of two cells (like=sum(A*B) if A and B…
kromuchi
  • 187
  • 1
  • 9