Class FormulaFunctions
The context supplied while executing custom formulas.
Contains all standard functions provided by StandardFunctions
Inheritance
FormulaFunctions
Inherited Members
StandardFunctions.IsIn(object, object, object, object, object, object, object, object, object, object, object)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Assembly: LemonEdge.API.dll
public class FormulaFunctions : StandardFunctions, IFormulaFunctions
Constructors
FormulaFunctions(IEntityRetriever, IReadOnlyCache, UserInfo, IFormulaFunctionsServiceContext)
Creates a new formula functions for helping with custom formulas as a context to operate against
Declaration
public FormulaFunctions(IEntityRetriever retriever, IReadOnlyCache cache, UserInfo user, IFormulaFunctionsServiceContext services)
Parameters
Properties
A local cache for retrieving already loaded standing data
Declaration
public IReadOnlyCache Cache { get; }
Property Value
A context that allows you to retrieve and query any data from the LemonEdge system for evaluation
Declaration
public IEntityRetriever Data { get; }
Property Value
The services demanded from the IServiceProvider that are utilized in the formula
Declaration
public IFormulaFunctionsServiceContext Services { get; }
Property Value
The current user running the formula
Declaration
public UserInfo User { get; }
Property Value
Methods
Evaluates the specified formula
and returns the result as the specified
T using the IScriptHelper
Declaration
public Task<T> Evaluate<T>(string formula, bool compileOnly = false)
Parameters
Type |
Name |
Description |
string |
formula |
The formula, or script, to be parsed and evaluated
|
bool |
compileOnly |
Whether to just compile the script for the purpose of initialisation, or also execute it.
|
Returns
Type Parameters
GetContextItemType(object)
Returns the entity name of the type this item is
Declaration
[FormulaFunction(Name = "GetContextItemType", Type = "Other", Description = "Returns the type name of the object this formula is executing against. For instance if executing against a fund it would return \"Fund\". Returns \"\" if there is no context objext.", Params = "", ParamCount = 0)]
public string GetContextItemType(object source)
Parameters
Type |
Name |
Description |
object |
source |
An item to return the name of the type for
|
Returns
Type |
Description |
string |
The name of the type this item is
|
Declaration
public Task<DataRow[]> GetDRQueryItems(string queryName, string parameters, string filter, string orderBy)
Parameters
Returns
Declaration
[FormulaFunction(Name = "GetEntityTypeID", Type = "Main", Description = "Returns the type id of a given custom entity, or system entity, from the supplied entity name.", Params = "1. The name of the entity to return the type id for.", ParamCount = 1, IsAsync = false)]
public Guid GetEntityTypeID(string entityName)
Parameters
Type |
Name |
Description |
string |
entityName |
|
Returns
Returns the code of the specified enum value
Can be the value itself, or if it has a specified enum value uses that instead, from
EnumCode
Declaration
[FormulaFunction(Name = "GetEnumCode", Type = "Main", Description = "Returns the code of the specified enum value. Can be the value itself, or if it has a specified enum value uses that instead, from ICustomListItem.EnumCode.", Params = "1. The enum value.", ParamCount = 1, IsAsync = false)]
public string GetEnumCode(object value)
Parameters
Type |
Name |
Description |
object |
value |
The enum value
|
Returns
Type |
Description |
string |
The code of the specified enum value
|
Returns the value of the specified enum value
Can be the value itself, or if it has a specified enum value uses that instead, from
EnumValue
Declaration
[FormulaFunction(Name = "GetEnumValue", Type = "Main", Description = "Returns the value of the specified enum value. Can be the value itself, or if it has a specified enum value uses that instead, from ICustomListItem.EnumValue.", Params = "1. The enum value.", ParamCount = 1, IsAsync = false)]
public decimal GetEnumValue(object value)
Parameters
Type |
Name |
Description |
object |
value |
The enum value
|
Returns
Type |
Description |
decimal |
The value of the specified enum value
|
GetExtendedObject(IBaseEntity, string, bool)
Declaration
[FormulaFunction(Name = "GetExtendedObject", Type = "Main", Description = "Gets an extended custom entity object for the specified item.", Params = "1. The main item to get an extended object from.\r\n2. The name of the extended custom entity.\r\n3. If the extended item doesn't yet exist marking this true will create it and return the object (with no properties set). With false null will be returned.", ParamCount = 3, IsAsync = true)]
public Task<object> GetExtendedObject(IBaseEntity item, string extendedTypeName, bool alwaysCreate)
Parameters
Returns
GetExtendedPropertyItem(IBaseEntity, string)
Declaration
protected Task<IBaseEntity> GetExtendedPropertyItem(IBaseEntity item, string extendedTypeName)
Parameters
Returns
GetExtendedPropertyValue(IBaseEntity, string, string)
Declaration
[FormulaFunction(Name = "GetExtendedPropertyValue", Type = "Main", Description = "Gets the value for the specified item for a extended custom property of it.", Params = "1. The main item to get an extended property for.\r\n2. The name of the extended custom entity.\r\n3. The name of the of the property on the extended type to retrieve the value of.", ParamCount = 3, IsAsync = true)]
public Task<object> GetExtendedPropertyValue(IBaseEntity item, string extendedTypeName, string extendedPropertyName)
Parameters
Returns
Returns the first IBaseEntities in a collection of the specified type that match the provided filter
Declaration
[FormulaFunction(Name = "GetFirstOrDefaultItem", Type = "Main", Description = "Returns the first IBaseEntities in a collection of the specified type that match the provided filter", Params = "1. The name of the type you want to return items for.\r\n2. The LemonEdge.Utils.QueryableFilter to use to filter the results", ParamCount = 2, IsAsync = true)]
public Task<IBaseEntity> GetFirstOrDefaultItem(string typeName, QueryableFilter filter)
Parameters
Type |
Name |
Description |
string |
typeName |
The entity type name (as defined in
ItemName attribute property) of the type of object to
return
|
QueryableFilter |
filter |
The queryable filter to filter the results
|
Returns
Returns the first IBaseEntities in a collection of the specified type that match the provided filter
Declaration
[FormulaFunction(Name = "GetFirstOrDefaultItem", Type = "Main", Description = "Returns the first IBaseEntities in a collection of the specified type that match the provided filter", Params = "1. The name of the type you want to return items for.\r\n2. The column name to filter by\r\n3. The LemonEdge.Utils.Database.SQLOperator to filter the column by\r\n4. The value to filter the column by", ParamCount = 4, IsAsync = true)]
public Task<IBaseEntity> GetFirstOrDefaultItem(string typeName, string columnName, SQLOperator op, object value)
Parameters
Type |
Name |
Description |
string |
typeName |
The entity type name (as defined in
ItemName attribute property) of the type of object to
return
|
string |
columnName |
The column name to filter on
|
SQLOperator |
op |
The operation to filter the column by
|
object |
value |
The value to filter the column name by
|
Returns
Declaration
[FormulaFunction(Name = "GetFirstOrDefaultItem", Type = "Main", Description = "Returns the first IBaseEntities in a collection of the specified type <T> that match the provided filter", Params = "1. The LemonEdge.Utils.QueryableFilter to use to filter the results", ParamCount = 1, IsAsync = true)]
public Task<T> GetFirstOrDefaultItem<T>(QueryableFilter filter) where T : IBaseEntity
Parameters
Returns
Type Parameters
Declaration
[FormulaFunction(Name = "GetFirstOrDefaultItem", Type = "Main", Description = "Returns the first IBaseEntities in a collection of the specified type <T> that match the provided filter", Params = "1. The column name to filter by\r\n2. The LemonEdge.Utils.Database.SQLOperator to filter the column by\r\n3. The value to filter the column by", ParamCount = 3, IsAsync = true)]
public Task<T> GetFirstOrDefaultItem<T>(string columnName, SQLOperator op, object value) where T : IBaseEntity
Parameters
Returns
Type Parameters
Returns an instance of the specified object type from its id
Declaration
[FormulaFunction(Name = "GetItem", Type = "Main", Description = "Returns an instance of the specified object type from its id.", Params = "1. The name of the type you want to return items for.\r\n2. The objects id", ParamCount = 2, IsAsync = true)]
public Task<IBaseEntity> GetItem(string typeName, Guid id)
Parameters
Type |
Name |
Description |
string |
typeName |
The entity type name (as defined in
ItemName attribute property) of the type of object to
return
|
Guid |
id |
The id of the item to return
|
Returns
Returns an instance of the specified object type from its id
Declaration
[FormulaFunction(Name = "GetItemAs", Type = "Main", Description = "Returns an instance of the specified object type <T> from its id.", Params = "1. The objects id", ParamCount = 1, IsAsync = true)]
public Task<T> GetItemAs<T>(Guid id) where T : IBaseEntity
Parameters
Type |
Name |
Description |
Guid |
id |
The id of the item to return
|
Returns
Type Parameters
Returns the id of the specified object a matching value of the specified data source key.
Declaration
[FormulaFunction(Name = "GetItemFromDataSourceID", Type = "Main", Description = "Returns the id of the specified object a matching value of the specified data source key.", Params = "1. The name of the data source type you are providing a key value to search for.\r\n2. The value of the data source key to search for and return the matching entity of", ParamCount = 2, IsAsync = true)]
public Task<Guid?> GetItemFromDataSourceID(string datasourceTypeName, string datasourceID)
Parameters
Type |
Name |
Description |
string |
datasourceTypeName |
The name of the data source type you are providing a key value to search for
|
string |
datasourceID |
The value of the data source key to search for and return the matching entity of
|
Returns
Type |
Description |
Task<Guid?> |
The id of the specified object a matching value of the specified data source key
|
Returns the id of the specified object a matching value of the specified data source key.
Declaration
[FormulaFunction(Name = "GetItemFromDataSourceID", Type = "Main", Description = "Returns the id of the specified object a matching value of the specified data source key.", Params = "1. The name of the type you want to return an id of.\r\n2. The name of the data source type you are providing a key value to search for.\r\n3. The value of the data source key to search for and return the matching entity of", ParamCount = 3, IsAsync = true)]
public Task<Guid?> GetItemFromDataSourceID(string typeName, string datasourceTypeName, string datasourceID)
Parameters
Type |
Name |
Description |
string |
typeName |
The name of the type you want to return an id of
|
string |
datasourceTypeName |
The name of the data source type you are providing a key value to search for
|
string |
datasourceID |
The value of the data source key to search for and return the matching entity of
|
Returns
Type |
Description |
Task<Guid?> |
The id of the specified object a matching value of the specified data source key
|
Returns the value for a specified propName
against an item
Declaration
public object GetItemPropertyValue(object item, string propName)
Parameters
Type |
Name |
Description |
object |
item |
The item to return the value of the specified property from
|
string |
propName |
The property to return the value from
|
Returns
Type |
Description |
object |
The value for a specified propName against an item
|
Returns a collection of IBaseEntities of the specified type that match the provided filter
Declaration
[FormulaFunction(Name = "GetItems", Type = "Main", Description = "Returns a collection of IBaseEntities of the specified type that match the provided filter.", Params = "1. The name of the type you want to return items for.\r\n2. The LemonEdge.Utils.QueryableFilter to use to filter the results", ParamCount = 2, IsAsync = true)]
public Task<IEnumerable<IBaseEntity>> GetItems(string typeName, QueryableFilter filter)
Parameters
Type |
Name |
Description |
string |
typeName |
The entity type name (as defined in
ItemName attribute property) of the type of object to
return
|
QueryableFilter |
filter |
The queryable filter to filter the results
|
Returns
Returns a collection of IBaseEntities of the specified type that match the provided filter
Declaration
[FormulaFunction(Name = "GetItems", Type = "Main", Description = "Returns a collection of IBaseEntities of the specified type that match the provided filter.", Params = "1. The name of the type you want to return items for.\r\n2. The column name to filter by\r\n3. The LemonEdge.Utils.Database.SQLOperator to filter the column by\r\n4. The value to filter the column by", ParamCount = 4, IsAsync = true)]
public Task<IEnumerable<IBaseEntity>> GetItems(string typeName, string columnName, SQLOperator op, object value)
Parameters
Type |
Name |
Description |
string |
typeName |
The entity type name (as defined in
ItemName attribute property) of the type of object to
return
|
string |
columnName |
The column name to filter on
|
SQLOperator |
op |
The operation to filter the column by
|
object |
value |
The value to filter the column name by
|
Returns
Declaration
[FormulaFunction(Name = "GetItems", Type = "Main", Description = "Returns a collection of the specified type <T> that match the provided filter.", Params = "1. The LemonEdge.Utils.QueryableFilter to use to filter the results", ParamCount = 1, IsAsync = true)]
public Task<IEnumerable<T>> GetItems<T>(QueryableFilter filter) where T : IBaseEntity
Parameters
Returns
Type Parameters
Declaration
[FormulaFunction(Name = "GetItems", Type = "Main", Description = "Returns a collection of the specified type <T> that match the provided filter.", Params = "1. The column name to filter by\r\n2. The LemonEdge.Utils.Database.SQLOperator to filter the column by\r\n3. The value to filter the column by", ParamCount = 3, IsAsync = true)]
public Task<IEnumerable<T>> GetItems<T>(string columnName, SQLOperator op, object value) where T : IBaseEntity
Parameters
Returns
Type Parameters
Declaration
[FormulaFunction(Name = "GetObjectValue", Type = "Main", Description = "Returns the value for the specified property for the specified item.", Params = "1. The item to get the property value of.\r\n2. The name of the property to retrieve.", ParamCount = 2, IsAsync = false)]
public object GetObjectValue(object item, string propertyName)
Parameters
Returns
Executes the specified ISQLWrapper and returns the count of results.
Declaration
public Task<int> GetQueryCount(string queryName, string parameters, string filter)
Parameters
Type |
Name |
Description |
string |
queryName |
The name of the ISQLWrapper to execute
|
string |
parameters |
Any parameters for executing the query in the form: @ParamName1=value1, @ParamName2=value2,
...
|
string |
filter |
A filter of the form XXX OP Value. See ParseWhere(Type, string)
|
Returns
Declaration
public Task<ISQLWrapperResult[]> GetQueryItems(string queryName, string parameters, string filter, string orderBy)
Parameters
Returns
Declaration
[FormulaFunction(Name = "GetQueryResult", Type = "Queries", Description = "Given a row returned from RunQueryResult, it can be passed in here to get any value.", Params = "1. The query result to get the value from\r\n2. The name of the column to return", ParamCount = 2, IsAsync = true)]
public Task<object> GetQueryResult(ISQLWrapperResult result, string columnName)
Parameters
Returns
Declaration
public Task<object> GetQueryResult(DataRow result, string columnName)
Parameters
Returns
Declaration
[FormulaFunction(Name = "GetQueryResult", Type = "Queries", Description = "Given a row returned from RunQueryResult, it can be passed in here to get any value.", Params = "1. The name of the query you want to return.\r\n2. The name of the column to return\r\n3. The query result to get the value from", ParamCount = 3, IsAsync = true)]
public Task<object> GetQueryResult(string queryName, string columnName, ISQLWrapperResult result)
Parameters
Returns
Declaration
[FormulaFunction(Name = "GetQueryResult", Type = "Queries", Description = "Given rows returned from RunQueryResult, it can be passed in here to get any value where a specifiec column has a specified result.", Params = "1. The name of the query you want to return.\r\n2. The name of the column to return\r\n3. The query results to get the value from\r\n4. The name of the column to filter the resuls by\r\n5. The value the result should have", ParamCount = 5, IsAsync = true)]
public Task<object> GetQueryResult(string queryName, string columnName, ISQLWrapperResult[] results, string whereColName, object equalsValue)
Parameters
Returns
Declaration
public Task<object> GetQueryResult(string queryName, string columnName, DataRow result)
Parameters
Returns
Declaration
[FormulaFunction(Name = "GetTaskID", Type = "Tasks", Description = "Returns the ID for the specified task type.", Params = "1. The name of the server task type.", ParamCount = 1, IsAsync = false)]
public Guid GetTaskID(string taskName)
Parameters
Type |
Name |
Description |
string |
taskName |
|
Returns
Declaration
[FormulaFunction(Name = "GetTaskParameter", Type = "Tasks", Description = "Returns the parameter class for settings paramaters for a specified task type.", Params = "1. The name of the server task type.", ParamCount = 1, IsAsync = false)]
public SerializedParam GetTaskParameter(string taskName)
Parameters
Type |
Name |
Description |
string |
taskName |
|
Returns
Executes the specified ISQLWrapper and returns true if there are any results
Declaration
[FormulaFunction(Name = "HasQueryResult", Type = "Queries", Description = "Returns True if there are any results when executing the SQLWrapper with the specified parameters.", Params = "1. The name of the query you want to return.\r\n2. param list of parameter name and value....", ParamCount = 2, IsAsync = true)]
public Task<bool> HasQueryResult(string queryName, params string[] parameters)
Parameters
Type |
Name |
Description |
string |
queryName |
The name of the ISQLWrapper to execute
|
string[] |
parameters |
Any parameters for executing the query in the form: @ParamName1=value1, @ParamName2=value2,
...
|
Returns
Type |
Description |
Task<bool> |
True if there are any results when executing the SQLWrapper with the specified parameters
|
Validates the given formula against this context type.
Throws an error with any compilation exceptions
Declaration
public bool IsValid<T>(string formula)
Parameters
Type |
Name |
Description |
string |
formula |
The formula, or script, to be parsed and evaluated
|
Returns
Type Parameters
Name |
Description |
T |
the would-be return type of the formula or script
|
Validates the given formula against the provided contextType.
Throws an error with any compilation exceptions
Declaration
public bool IsValid<T>(string formula, Type contextType)
Parameters
Type |
Name |
Description |
string |
formula |
The formula, or script, to be parsed and evaluated
|
Type |
contextType |
The context object that can be referenced by the formula or script
|
Returns
Type Parameters
Name |
Description |
T |
the would-be return type of the formula or script
|
Logs an error message to the application log
Declaration
[FormulaFunction(Name = "LogError", Type = "Debugging", Description = "Logs an error message to the application log.", Params = "1. The error you want to log.\r\n2. The message, which can have tokens, for example: \"MyId: {Guid} | MyObject: {@Currency}.\". \r\nThe number of tokens must match the number of extra arguments.\r\nPutting an @ symbol inside the token {@Currency} will render out the entire object in the log.\r\n3. The arguments, which are a comma separated set of objects. There must be as many as there are tokens in the message.\r\nSo, give the message above, the call looks like this: LogError(new Exception(\"No item found!\"), \"MyId: {Guid} | MyObject: {@Currency}.\", someGuid, currency)", ParamCount = 3)]
public void LogError(Exception error, string message, params object[] parameters)
Parameters
Type |
Name |
Description |
Exception |
error |
The exception
|
string |
message |
The message to log
|
object[] |
parameters |
The parameter array
|
Logs a message to the application log
Declaration
[FormulaFunction(Name = "LogInfo", Type = "Debugging", Description = "Logs a message to the application log.", Params = "1. The message, which can have tokens, for example: \"MyId: {Guid} | MyObject: {@Currency}.\". \r\nThe number of tokens must match the number of extra arguments.\r\nPutting an @ symbol inside the token {@Currency} will render out the entire object in the log.\r\n2. The arguments, which are a comma separated set of objects. There must be as many as there are tokens in the message.\r\nSo, given the message above, the call looks like this: LogInfo(\"MyId: {Guid} | MyObject: {@Currency}.\", someGuid, currency)", ParamCount = 2)]
public void LogInfo(string message, params object[] parameters)
Parameters
Type |
Name |
Description |
string |
message |
The message to log
|
object[] |
parameters |
The parameter array
|
Declaration
public Task<DataRow[]> RunDRQueryResult(string queryName, params string[] parameters)
Parameters
Returns
Executes the specified ISQLWrapper and returns the value of the specified column from
the first result
Declaration
[FormulaFunction(Name = "RunQuery", Type = "Queries", Description = "Returns the result of the first row for a specified column of running the specified query.", Params = "1. The name of the query you want to return.\r\n2. The name of the column value to return\r\n3. param list of parameter name and value....", ParamCount = 3, IsAsync = true)]
public Task<object> RunQuery(string queryName, string columnName, params string[] parameters)
Parameters
Type |
Name |
Description |
string |
queryName |
The name of the ISQLWrapper to execute
|
string |
columnName |
The column Name in the SQLWrapper to return the
value of
|
string[] |
parameters |
Any parameters for executing the query in the form: @ParamName1=value1, @ParamName2=value2,
...
|
Returns
Type |
Description |
Task<object> |
The value of the specified column from the first result of executing the SQLWrapper
|
Declaration
[FormulaFunction(Name = "RunQueryResult", Type = "Queries", Description = "Returns an array of ISQLWrapperResult for running the specified query. Can be used with GetQueryResult to find all the values returned for all rows.", Params = "1. The name of the query you want to return.\r\n2. param list of parameter name and value....", ParamCount = 2, IsAsync = true)]
public Task<ISQLWrapperResult[]> RunQueryResult(string queryName, params string[] parameters)
Parameters
Returns
Declaration
[FormulaFunction(Name = "SetObjectValue", Type = "Main", Description = "Set the value for the specified property for the specified item.", Params = "1. The item to update the property value of.\r\n2. The name of the property to update.\r\n3. The value to set the property to", ParamCount = 3, IsAsync = false)]
public void SetObjectValue(object item, string propertyName, object value)
Parameters
Declaration
public void SetQueryRunnerHelper(Func<IEntityUpdater, ISQLWrapperInterpretor, Dictionary<string, string>, QueryableExecuter<ISQLWrapperResult>, Task<DataRow[]>> queryRunner)
Parameters
Declaration
public virtual void ShareThisQueryCacheWithTarget(IFormulaFunctions targetContext)
Parameters
Declaration
[FormulaFunction(Name = "TWR", Type = "Queries", Description = "Executes the specified SQLWrapper gets all the specified date, values and cash flow deltas and then returns a calculated twr based on them", Params = "1. The name of the query to execute.\r\n2. The name of the column holding the date values\r\n3. The name of the column holding the value delta\r\n4. The name of the column holding the cashflow delta\r\n5. param list of parameter name and value....", ParamCount = 5, IsAsync = true)]
public Task<decimal> TWR(string queryName, string dateColumn, string valueDeltaColumn, string cashFlowDeltaColumn, params string[] parameters)
Parameters
Returns
Declaration
[FormulaFunction(Name = "TWRRow", Type = "Queries", Description = "Executes the specified SQLWrapper gets all the specified date, values and cash flow deltas and then returns a calculated twr based on them", Params = "1. The name of the query to execute.\r\n2. The name of the column holding the date values\r\n3. The name of the column holding the cashflow type (TWRValueType)\r\n4. The name of the column holding the delta of type specified in 3\r\n5. param list of parameter name and value....", ParamCount = 5, IsAsync = true)]
public Task<decimal> TWRRow(string queryName, string dateColumn, string valueDeltaColumn, string cashFlowDeltaColumn, params string[] parameters)
Parameters
Returns
Declaration
[FormulaFunction(Name = "XIRR", Type = "Queries", Description = "Executes the specified SQLWrapper gets all the specified date and cash flow values and then returns a calculated xirr based on them", Params = "1. The name of the query to execute.\r\n2. The name of the column holding the date values\r\n3. The name of the column holding the cash flow values\r\n4. param list of parameter name and value....", ParamCount = 4, IsAsync = true)]
public Task<decimal> XIRR(string queryName, string dateColumn, string cashColumn, params string[] parameters)
Parameters
Returns
Declaration
[FormulaFunction(Name = "XIRR", Type = "Queries", Description = "Executes the specified SQLWrapper gets all the specified date and cash flow values (matching specified filters) and then returns a calculated xirr based on them", Params = "1. The name of the query to execute.\r\n2. The name of the column holding the date values\r\n3. The name of the column holding the cash flow values\r\n4. Array of (string ColName, object Value) holding values to filter the cashflow/date rows used.\r\n4. param list of parameter name and value....", ParamCount = 4, IsAsync = true)]
public Task<decimal> XIRR(string queryName, string dateColumn, string cashColumn, (string, object)[] whereFilters, params string[] parameters)
Parameters
Returns
Implements
Extension Methods
See Also