Filtering tables with finaquant® protos

All the C# code examples presented on this page can be found in the related demo function of MS Visual Studio project FinaquantProtosStarter which can be downloaded at the product page of the free .NET library finaquant® protos.
As explained below in detail, finaquant® protos (free .net library) offers several table functions for selecting or deselecting rows of tables1. Three methods are available for filtering tables:

  1. Filtering with condition table
  2. Filtering with condition cell
  3. Filtering with condition list (array of condition cells)

These filtering functions constitute the basis for powerful and versatile table transformation functions like the function router that map selected subtables to corresponding table functions to generate an array of results. In that sense, filtering functions are the foundation of rule-based calculations (rule engine); they determine, which subset of rows (i.e. subtables) are fed to which table functions with which set of parameters. Continue reading

Digiprove sealCopyright secured by Digiprove © 2013 Tunc Ali Kütükcüoglu
  1. Table functions for filtering rows of tables are available in releases 1.02 and higher. []
Posted in Calculation engine | Tagged , | Leave a comment

Sorting tables with finaquant® protos

All the C# code examples presented on this page can be found in the related demo function of MS Visual Studio project FinaquantProtosStarter which can be downloaded at the product page of the free .NET library finaquant® protos.
Sorting rows of tables after some fields may be required for certain table calculations. The table function SortRows()1 in finaquant® protos (free .net library) can be used for sorting tables:

// Sort table after given fields and sort options (ASC/DESC).
// Sort after all fields in order (ASC) if SortStr is null or empty string ""
// Tbl: Input table
// SortStr: Comma separated field names and sort option, like "field1 ASC, field2 DESC"
// Returns: Sorted table
public static MatrixTable SortRows(MatrixTable Tbl, string SortStr = null)

You may find some examples with the CostTable below. Continue reading

Digiprove sealCopyright secured by Digiprove © 2013 Tunc Ali Kütükcüoglu
  1. This table function is available in releases 1.02 and higher []
Posted in Calculation engine | Tagged , | Leave a comment

Creating test tables with finaquant® protos – 2

All the C# code examples presented on this page can be found in the related demo function of MS Visual Studio project FinaquantProtosStarter which can be downloaded at the product page of the free .NET library finaquant® protos.
CombinateTableRows()1 is a table function in finaquant® protos (free .net library) which can be used for generating test tables including any number of dependent and independent attributes.

public static MatrixTable CombinateTableRows(params MatrixTable[] TableArray)

This table function creates test tables by combinating (i.e. cartesian multiplication) the rows of any number of input tables, provided that these tables have no common fields.

CombinateTableRows() is the more general and mightier alternative to CombinateFieldValues_B() which was introduced in the previous related article. With CombinateTableRows() it is possible to create test tables with dependent as well as independent fields.

Following example shows how a test table with 8 fields can be generated with dependent attribute pairs category-product, country-brand and date-year. Continue reading

Digiprove sealCopyright secured by Digiprove © 2012 Tunc Ali Kütükcüoglu
  1. This table function is available in releases 1.02 and higher []
Posted in Calculation engine | Tagged , | Leave a comment

Creating test tables with finaquant® protos – 1

CombinateFieldValues_B()1 is one of the several table functions in finaquant® protos (free .net library) which can be used for generating test tables including any number of independent attributes.

public static MatrixTable CombinateFieldValues_B(TableFields TFields,
	Dictionary TextAttribValues, Dictionary NumAttribValues,
	KeyValueRange DefaultRangeForAllKeyFigures, Dictionary RangeForSelectedFigures = null,
	string DefaultTextVal = "EMPTY", int DefaultNumVal = 0, int RandomSeed = 100)

Following example shows how a test table (CostTable) with five independent attributes (category, product, brand, modelyear, date) and three random-valued key figures (costs, margin, sales) can be created in six steps. Continue reading

Digiprove sealCopyright secured by Digiprove © 2012 Tunc Ali Kütükcüoglu
  1. This table function is available in releases 1.02 and higher []
Posted in Calculation engine | Tagged , | Leave a comment