Wednesday, February 18, 2015

Calculated Column & Caclulated value in Sharepoint 2010

We have Calculated columns in Sharepoint. The data in these columns can be set based on other column Information. These columns will not be displayed in New / Edit forms as the data in these columns and are calculated internally according to the formula provided by us, before saving the record in database.

You can see simple example in below image, where we are fetching Request Created Day based on created date field.


Use this link to know more about the formulas for calculated columns.

One important point to remember about these columns is, The calculation of the value is done only when an Item created and updated. So, we can't use general functions like 'Today' , 'Me' in the formula.

We can also set Calculated value for Default value to a column. If there are any requirements where default value is to be calculated, we use this.

As an example, if we want to set default value for a title in Status list with Date in it as "Status as on [Date]", we can use below formula in Default value by selecting 'Calculated Value'

 ="Status as on "&TEXT(Today,"dd/mm/yyyy")


Important point to remember here is, We can't use other columns in these formulas as these are calculated before the Edit / New screen loaded and by then we don't have data in other columns.

We can use generic formula like 'Today' or 'Me' and the value set with corresponding data when the screen loaded.

No comments:

Post a Comment