calculated-columns

Calculating correlation coefficient using PostgreSQL?

I have worked out how to calculate the correlation coefficient between two fields if both are in the same table: SELECT corr(column1, column2) FROM table WHERE <my filters>; ...but I can't work out how to do it when the columns are from different tables (I need to apply the same filters to both tables). Any hints, please? ...

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 this: =HVIS([YTD]<=[Budget]; "OK"; "Not OK") But this just leaves with the same syntax...

Having a generated column depend on other generated columns

What would be the best way of doing this? select 'blah' as foo, CASE WHEN foo='blah' THEN 'fizz' ELSE 'buzz' END as bar As it is written right now I get an invalid column name 'foo' error. Is there anyway to do this where the select statement could be used as a view? ...

Stored Procedure

Hello, i'm stuck with creating a stored procedure that should update a calculated column daily. Unfortunately my knowledge about stored procedures is limited but it seems to be the right place. I try to give more background informations: The Main-Table stores claims and is called tabData. It has a column 'IsReturn' with datatype bit(b...

Invalid column name error in WHERE clause, column selected with CASE

I have a (rather complicated) SQL statement where I select data from lots of different tables, and to cope with a bad legacy data structure, I have a couple of custom columns that get their values based on values from other columns. I have currently solved this with CASE statements: SELECT ..., CASE channel WHEN 1 T...

NHibernate: Conditionally load a calculated column

I have the following proprty <property name="Allocated" type="decimal" formula="(select sum(a.AllocationAmount) from Allocation a where a.TransactionId = TransactionId)" /> This loads the amount of a Transaction that has been allocated to invoices which is working beautifully. However, is most cases I don't care about this amount. ...

jqgrid - change column header name automatically according to the width

in my site , i have a jqgrid table. by default, the names of the columns (header) is longer than the width for column, because that i set the name with an ellipsis. however, when resizing the column, the short name with ellipsis stays. how can i get it work automatic , like the ellipsis should disappear and change to the full name wh...

Sharepoint Calculated Column Substring

Hi all Need help with a Calculated column issue in SharePoint 2007 Basically, I'm trying to take the value from the [Contact E-Mail Address] column and remove the mailto: part infront which Sharepoint automatically created. Original Column Value : mailto:[email protected] Calculated column required value: [email protected] This is what i've go...

Syncing column width of between tables in two different frames, etc...

For reasons which are somewhat unavoidable (lots of legacy code, compatibility, design needs) I have the following problem: I have two tables, one directly below the other, but split between two frames (see the pseudo-example below my sig.). I need the column widths of these tables to synchronize exactly so that these two tables 'act...

Calculating an array of values in C# (Formula convert from Excel)

Hi all, I'm currently building a semi-complicated calculator which is basically a conversion from an Excel spreadsheet I've been provided. I've nailed most of it but there's a part in the Excel spreadsheet where multiple calculations occur between 6 rows and 7 columns, but the issue is that the calculations happen in no particular orde...

How do I add a calculated column to my EF4 model?

Given a "User" table and a "Login" table in MS SQL 2008: CREATE TABLE [dbo].[User_User]( [UserID] [int] IDENTITY(1000,1) NOT NULL, [UserName] [varchar](63) NOT NULL, [UserPassword] [varchar](63) NOT NULL ) CREATE TABLE [dbo].[Util_Login]( [LoginID] [int] IDENTITY(1000,1) NOT NULL, [User_UserID] [int] NOT NULL, -- FK ...

How to sort a TEXT Date Column in sharepoint ?

Hi, I have data :- 31-May-07 Its in a calculated column of the list. The method I used to get it :- =IF(FDate="","",TEXT(FDate,"dd-mmm-yy")) {FDate is a DateTime type of column. The returned value is stored in a "Single Line of Text" column type.} I am now unable to sort that column as its Text now and sorting is done on basis of strin...