---
title: "Lusid.Fund.ValuationPoint.Writer"
slug: "lusidfundvaluationpointwriter"
updated: 2024-10-15T15:18:47Z
published: 2024-10-15T15:18:47Z
canonical: "support.lusid.com/lusidfundvaluationpointwriter"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lusid.Fund.ValuationPoint.Writer

| **Type** | **Read/write** | **Author** | **Availability** |
| --- | --- | --- | --- |
| [Data provider](/v1/docs/what-are-a-data-provider-and-a-direct-provider) | Write | FINBOURNE | Provided with LUSID |

Providing you have sufficient [access control permissions](/v1/docs/creating-policies-to-control-access-to-providers-for-different-luminesce-end-users), the `Lusid.Fund.ValuationPoint.Writer` provider enables you to write a [Luminesce SQL query](/v1/docs/understanding-the-luminesce-sql-query-syntax) that creates, updates or deletes [accounting diary entries](/v1/docs/what-is-an-accounting-diary-entry) of type `ValuationPoint`.

> **Note**: By default, `Lusid.Fund.ValuationPoint.Writer` cannot add properties to diary entries. To do this, you must first configure `Lusid.Fund.ValuationPoint.Writer` to 'inline' properties from the `DiaryEntry` domain. [See how to do this](/v1/docs/how-do-i-configure-luminesce-entity-providers-to-readwrite-properties).

You must construct a valid table of data to write, one valuation point per record. `Lusid.Fund.ValuationPoint.Writer` lists the fields (columns) available to populate with values for each record, and has a set of parameters to help you construct a valid table.

Your query can use the `WriteAction` field to perform one of the following operations:

- Upsert a valuation point; that is, create one with a status of `Estimate` if it does not exist, and update it if it does *and* is still an `Estimate`. Note you cannot update a valuation point whose status has moved to `Candidate` or `Final`. This is the default operation if you omit `WriteAction`.
- Delete a valuation point (of any status).

Once you have created a valuation point, you can use it to [value a fund](/v1/docs/lusidfundvaluationpointdata) at a specific point in time, and persist the underlying data.

**See also:** [Lusid.Fund.ValuationPoint](/v1/docs/lusidfundvaluationpoint), [Lusid.Fund.ValuationPointData](/v1/docs/lusidfundvaluationpointdata)

## Basic usage

```sql
@table_of_data = <select-statement>;
select * from Lusid.Fund.ValuationPoint.Writer where toWrite = @table_of_data;
```

## Query parameters

`Lusid.Fund.ValuationPoint.Writer` has parameters that help you construct a valid table of data to write.

> **Note:** The `ToWrite` parameter is mandatory and used to actually write the table of data into LUSID.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Lusid.Fund.ValuationPoint.Writer' and FieldType = 'Parameter';
```

## Data fields

`Lusid.Fund.ValuationPoint.Writer` lists the fields you can populate in your table of data to write.

Depending on the operation you want to perform, the following fields are mandatory to include in the table of data:

| **Operation** | **Specify using...** | **Mandatory fields** |
| --- | --- | --- |
| Upsert | `'Upsert' as WriteAction` (or omit) | `DiaryEntryCode` `FundScope` `FundCode` `DisplayName` `EndDate` |
| Delete | `'Delete' as WriteAction` | `DiaryEntryCode` `FundScope` `FundCode` |

To list all available fields, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Lusid.Fund.ValuationPoint.Writer' and FieldType = 'Column';
```

## Write errors

We recommend examining the results of every write query using one or more of the `WriteError`, `WriteErrorCode` and `WriteErrorDetail` fields.

For each record in the table of data to write, `Lusid.Fund.ValuationPoint.Writer` returns an error code. If the operation is successful, the error code is `0`. If unsuccessful, a positive error code and explanation help you discover why LUSID considers the operation invalid.

## Examples

> **Note:** For more example Luminesce SQL queries, visit our [Github repo](https://github.com/finbourne/luminesce-examples/tree/master/examples/lusid/abor).

### Example 1: Add a valuation point to a fund

```sql
@data_to_write = select 'Growth' as FundScope, 'Equities' as FundCode, '2024-06-20-5pm' as DiaryEntryCode,
'2024-06-20-5pm' as DisplayName, #2024-06-20 17:00:00# as EndDate;
select * from Lusid.Fund.ValuationPoint.Writer where ToWrite = @data_to_write;
```

### Example 2: Add the same valuation point to different funds

```sql
@funds = values
('Growth', 'Equities'),
('Retirement', 'FixedIncome')
;
@data_to_write = select column1 as FundScope, column2 as FundCode, '2024-06-20-5pm' as DiaryEntryCode,
'2024-06-20-5pm' as DisplayName, #2024-06-20 17:00:00# as EndDate from @funds
;
select * from Lusid.Fund.ValuationPoint.Writer where ToWrite = @data_to_write;
```

### Example 3: Delete a valuation point

```sql
@data_to_write = select 'Growth' as FundScope, 'Equities' as FundCode, '2024-06-20-5pm' as DiaryEntryCode, 'Delete' as WriteAction;
select * from Lusid.Fund.ValuationPoint.Writer where ToWrite = @data_to_write;
```
