example FinanceColim1

####################################
# Financial Data Warehousing

typeside Ty = literal {
	external_types
		Integer -> "java.lang.Integer"
		String -> "java.lang.String"
		Double -> "java.lang.Double"
		Boolean -> "java.lang.String"
		Date -> "java.lang.String"
	external_parsers
		Integer -> "parseInt;"
		String -> "x => x"
		Double -> "x => java.lang.Double.parseDouble(x)"
		Boolean -> "x => x"
		Date -> "x => x"
	external_functions
		keygen : Integer,Integer,Integer -> Integer = "(x, y, z) => (2^x * 3^y * 5^z)"
}

####################################

schema Client = literal : Ty {
	entities
		client
	attributes
		id : client -> Integer
		name description : client -> String
}

instance ClientInstance = literal : Client {
     generators
     	cc1 cc2 cc3 : client
     multi_equations
     	id -> {cc1 1, cc2 2, cc3 3}
     	name -> {cc1 Tom, cc2 Dick, cc3 Harry}
     	description -> {cc1 "Tom Client", cc2 "Dick Client", cc3 "Harry Client"}
}

####################################

schema Portfolio = literal : Ty {
	entities
		strategy
		portfolio
	foreign_keys
		strategy : portfolio -> strategy
		parent : portfolio -> portfolio
	path_equations
		portfolio.parent.parent = portfolio.parent
	attributes
		id : strategy -> Integer
		name description : strategy -> String
		id : portfolio -> Integer
		name description : portfolio -> String
		client_id strategy_id parent_id : portfolio -> Integer
	observation_equations
		forall p. p.strategy.id = p.strategy_id
		forall p. p.parent.id = p.parent_id
}

instance PortfolioInstance = literal : Portfolio {
    generators
     	ps1 ps2 ps3 : strategy
     	pp1 pp2 pp3 : portfolio
	multi_equations
		parent_id -> {pp1 1, pp2 2, pp3 2}
		parent -> {pp1 pp1, pp2 pp2, pp3 pp2}
		id -> {ps1 1, ps2 2, ps3 3, pp1 1, pp2 2, pp3 3}
		name -> {ps1 Strat1, ps2 Strat2, ps3 Strat3, pp1 Port1, pp2 Port2, pp3 Port3}
		description -> {ps1 Strategy1, ps2 Strategy2, ps3 Strategy3, pp1 Portfolio1, pp2 Portfolio2, pp3 Portfolio3}
		strategy_id -> {pp1 2, pp2 2, pp3 1}
		client_id -> {pp1 1, pp2 2, pp3 2}
		strategy -> {pp1 ps2, pp2 ps2, pp3 ps1}
}

####################################

schema Ref = literal : Ty {
	entities
		country
		currency
		asset
		strategy
	foreign_keys
		country : currency -> country
		strategy : asset -> strategy
	attributes
		id : country -> Integer
		code name : country -> String
		id strategy_id : asset -> Integer
		name description : asset -> String
		id : strategy -> Integer
		name description : strategy -> String
		id country_id : currency -> Integer
		code name : currency -> String
	observation_equations
		forall c. c.country.id = c.country_id
		forall a. a.strategy.id = a.strategy_id
}

instance RefInstance = literal : Ref {
     generators
     	rcty1 rcty2 rcty3 rcty4 rcty5 rcty6 : country
		rcur1 rcur2 rcur3 : currency
		ra1 ra2 ra3 ra4 ra5 ra6 ra7 ra8 ra9 ra10 : asset
		rs1 rs2 rs3 rs4 rs5 : strategy
	multi_equations
		country -> {rcur1 rcty6, rcur2 rcty4, rcur3 rcty5}
		country_id  -> {rcur1 6, rcur2 4, rcur3 5}
		strategy -> {ra1 rs1, ra2 rs3, ra3 rs2, ra4 rs4, ra5 rs5, ra6 rs4, ra7 rs4, ra8 rs5, ra9 rs3, ra10 rs1}
		strategy_id  -> {ra1 1, ra2 3, ra3 2, ra4 4, ra5 5, ra6 4, ra7 4, ra8 5, ra9 3, ra10 1}
		id  -> {rcty1 1, rcty2 2, rcty3 3, rcty4 4, rcty5 5, rcty6 6, rcur1 1, rcur2 2, rcur3 3, ra1 1, ra2 2, ra3 3, ra4 4, ra5 5, ra6 6, ra7 7, ra8 8, ra9 9, ra10 10, rs1 1, rs2 2, rs3 3, rs4 4, rs5 5}
		code  -> {rcty1 AU, rcty2 CH, rcty3 CN, rcty4 EU, rcty5 JP, rcty6 US, rcur1 USD, rcur2 EUR, rcur3 JPY}
		name  -> {ra1 A1, ra2 A2, ra3 A3, ra4 A4, ra5 A5, ra6 A6, ra7 A7, ra8 A8, ra9 A9, ra10 A10, rs1 Strat1, rs2 Strat2, rs3 Strat3, rs4 Strat4, rs5 Strat5, rcty1 Australia, rcty2 Switzerland, rcty3 China, rcty4 "European Union", rcty5 Japan, rcty6 "United States of America", rcur1 "US Dollar", rcur2 "Euro", rcur3 "Japanese Yen" }
		description  -> {ra1 Asset1, ra2 Asset2, ra3 Asset3, ra4 Asset4, ra5 Asset5, ra6 Asset6, ra7 Asset7, ra8 Asset8, ra9 Asset9, ra10 Asset10, rs1 Strategy1, rs2 Strategy2, rs3 Strategy3, rs4 Strategy4, rs5 Strategy5}
}

####################################

schema Trans = literal : Ty {
	entities
		asset
		currency
		transaction
	foreign_keys
		asset : transaction -> asset
		currency : transaction -> currency
	attributes
		id : asset -> Integer
		name description : asset -> String
		id : currency -> Integer
		code name : currency -> String
		id asset_id portfolio_id quantity currency_id : transaction -> Integer
		date  : transaction -> Date	# added as a new column
		buy_sell_ind : transaction -> Boolean
		price : transaction -> Double
	observation_equations
		forall t. t.asset.id = t.asset_id
		forall t. t.currency.id = t.currency_id
}

instance TransInstance = literal : Trans {
     generators
		ta1 ta3 ta5 ta7 ta9 : asset
		tc1 tc2 tc3 : currency
		tt1 tt2 tt3 tt4 tt5 tt6 : transaction
	multi_equations
		id -> {ta1 1, ta3 3, ta5 5, ta7 7, ta9 9, tc1 1, tc2 2, tc3 3, tt1 1, tt2 2, tt3 3, tt4 4, tt5 5, tt6 6}
		name -> {ta1 A1, ta3 A3, ta5 A5, ta7 A7, ta9 A9, tc1 "US Dollar", tc2 Euro, tc3 "Japanese Yen"}
		description -> {ta1 Asset1, ta3 Asset3, ta5 Asset5, ta7 Asset7, ta9 Asset9}
		code -> {tc1 USD, tc2 EUR, tc3 JPY}
		asset -> {tt1 ta1, tt2 ta1, tt3 ta3, tt4 ta3, tt5 ta5, tt6 ta5}
		asset_id -> {tt1 1, tt2 1, tt3 3, tt4 3, tt5 5, tt6 5}
		portfolio_id -> {tt1 1, tt2 1, tt3 2, tt4 2, tt5 3, tt6 3}
		buy_sell_ind -> {tt1 buy, tt2 sell, tt3 buy, tt4 sell, tt5 buy, tt6 sell}
		quantity -> {tt1 200, tt2 100, tt3 150, tt4 150, tt5 200, tt6 100}
		price -> {tt1 "5.51", tt2 "5.5", tt3 "2.5", tt4 "3.5", tt5 "1.6", tt6 "1.5"}
		date -> {tt1 "1/1/2011", tt2 "6/1/2011", tt3 "9/1/2013", tt4 "3/1/2014", tt5 "2/1/2013", tt6 "7/1/2013"}
		currency -> {tt1 tc2, tt2 tc2, tt3 tc1, tt4 tc1, tt5 tc3, tt6 tc3}
		currency_id -> {tt1 2, tt2 2, tt3 1, tt4 1, tt5 3, tt6 3}
}

####################################

schema HoldPos = literal : Ty {
	entities
		client
		holding
		position
	foreign_keys
		client : holding -> client
		client : position -> client
	attributes
		no : client -> Integer	# new name
		nm desc : client -> String	# new name
		id client_no portfolio_id asset_id quantity : holding -> Integer
		purchase_date begin_date end_date : holding -> Date
		purchase_price : holding -> Double
		currency_code : holding -> String	# switched from _id to _code
		id client_no asset_id quantity current_value cost_basis : position -> Integer	# new name
		current_value_currency_code cost_basis_currency_code : position -> String	# switched from _id to _code
	observation_equations
		forall h:holding. h.client.no = h.client_no
		forall p:position. p.client.no = p.client_no
}

instance HoldPosInstance = literal : HoldPos {
    generators
  		hpc1 hpc2 : client
		hph1 hph2 hph3 hph4 hph5 : holding
		hpp1 hpp2 : position
	multi_equations
		no -> {hpc1 1, hpc2 2}
		nm -> {hpc1 Tom, hpc2 Dick}
		desc -> {hpc1 "Tom Client", hpc2 "Dick Client"}
		id -> {hph1 1, hph2 2, hph3 3, hph4 4, hph5 5, hpp1 1, hpp2 2}
		client_no -> {hph1 1, hph2 1, hph3 2, hph4 2, hph5 2, hpp1 1, hpp2 2}
		client -> {hph1 hpc1, hph2 hpc1, hph3 hpc2, hph4 hpc2, hph5 hpc2, hpp1 hpc1, hpp2 hpc2}
		portfolio_id -> {hph1 1, hph2 1, hph3 3, hph4 3, hph5 3}
		asset_id -> {hph1 1, hph2 1, hph3 3, hph4 5, hph5 5}
		quantity -> {hph1 200, hph2 100, hph3 150, hph4 200, hph5 100, hpp1 100, hpp2 100}
		purchase_date -> {hph1 "1/1/2011", hph2 "1/1/2011", hph3 "9/1/2013", hph4 "2/1/2013", hph5 "2/1/2013"}
		begin_date -> {hph1 "1/1/2011", hph2 "6/1/2011", hph3 "9/1/2013", hph4 "2/1/2013", hph5 "7/1/2013"}
		end_date -> {hph1 "6/1/2011", hph3 "3/1/2014", hph4 "7/1/2013"}
		purchase_price -> {hph1 "5.51", hph2 "5.1", hph3 "2.5", hph4 "1.6", hph5 "1.6"}
		currency_code -> {hph1 EUR, hph2 EUR, hph3 JPY, hph4 USD, hph5 USD}
		asset_id -> {hpp1 1, hpp2 5}
		current_value -> {hpp1 550, hpp2 170}
		cost_basis -> {hpp1 551, hpp2 160}
		current_value_currency_code -> {hpp1 EUR, hpp2 JPY}
		cost_basis_currency_code -> {hpp1 EUR, hpp2 JPY}
}

####################################

schema_colimit Colimit = quotient Client + Ref + Trans + Portfolio + HoldPos : Ty {
	 entity_equations
		Client.client = HoldPos.client
		Ref.asset     = Trans.asset
		Ref.currency  = Trans.currency
		Ref.strategy  = Portfolio.strategy
	observation_equations
		forall x. x.Client_client_id          = x.HoldPos_client_no
		forall x. x.Client_client_name        = x.HoldPos_client_nm
		forall x. x.Client_client_description = x.HoldPos_client_desc

		forall x. x.Ref_strategy_id          = x.Portfolio_strategy_id
		forall x. x.Ref_strategy_name        = x.Portfolio_strategy_name
		forall x. x.Ref_strategy_description = x.Portfolio_strategy_description

		forall x. x.Ref_asset_id          = x.Trans_asset_id
		forall x. x.Ref_asset_name        = x.Trans_asset_name
		forall x. x.Ref_asset_description = x.Trans_asset_description

		forall x. x.Ref_currency_id   = x.Trans_currency_id
		forall x. x.Ref_currency_code = x.Trans_currency_code
		forall x. x.Ref_currency_name = x.Trans_currency_name
	options
		simplify_names=false
}

instance ClientFwd = sigma (getMapping Colimit Client) ClientInstance
instance PortfolioFwd = sigma (getMapping Colimit Portfolio) PortfolioInstance
instance RefFwd = sigma (getMapping Colimit Ref) RefInstance
instance TransFwd = sigma (getMapping Colimit Trans) TransInstance
instance HoldPosFwd = sigma (getMapping Colimit HoldPos) HoldPosInstance

instance CoProd = coproduct ClientFwd + PortfolioFwd + RefFwd + TransFwd + HoldPosFwd : getSchema Colimit

####################################

instance E = quotient_query CoProd {
	entity Client_client__HoldPos_client -> {
		from
			a:Client_client__HoldPos_client b:Client_client__HoldPos_client
		where
			a.Client_client_id = b.HoldPos_client_no
	}
	entity Ref_asset__Trans_asset -> {
		from
			a:Ref_asset__Trans_asset b:Ref_asset__Trans_asset
		where
			a.Ref_asset_id = b.Trans_asset_id
	}
	entity Ref_currency__Trans_currency -> {
		from
			a:Ref_currency__Trans_currency b:Ref_currency__Trans_currency
		where
			a.Ref_currency_id = b.Trans_currency_id
	}
	entity Portfolio_strategy__Ref_strategy -> {
		from
			a:Portfolio_strategy__Ref_strategy b:Portfolio_strategy__Ref_strategy
		where
			a.Portfolio_strategy_id = b.Ref_strategy_id
	}

	options
		quotient_use_chase = false
}

####################################

schema Target = literal : Ty {
	entities
		currency #Trans Ref
		strategy #Portfolio Ref
		asset #Trans Ref
		transaction #Trans
		client #HoldPos
		position #HoldPos
		country #Ref
		portfolioholding #NEW
		portfolio #Portfolio
		holding #HoldPos

	foreign_keys
		portfolio_strategy : portfolio -> strategy #Portfolio
		parent : portfolio -> portfolio

		position_client : position -> client #HoldPos
		position_asset : position -> asset #NEW
		position_current_value_currency : position -> currency #NEW
		position_cost_basis_currency : position -> currency #NEW

		asset_strategy : asset -> strategy #Ref

		currency_country : currency -> country #Ref

		transaction_currency : transaction -> currency #Trans
		transaction_asset : transaction -> asset #Trans
		transaction_portfolio : transaction -> portfolio #NEW

		holding_currency : holding -> currency #NEW
		holding_asset : holding -> asset

		portfolioholding_holding : portfolioholding -> holding #NEW
		portfolioholding_client : portfolioholding -> client #NEW
		portfolioholding_portfolio : portfolioholding -> portfolio #NEW

	path_equations
		portfolio.parent.parent = portfolio.parent

	attributes
		code : currency -> String #Trans Ref
		name : currency -> String #Trans Ref
		id : currency -> Integer #Ref
		country_id : currency -> Integer #Ref

		code : country -> String #Ref
		name : country -> String #Ref
		id : country -> Integer #Ref

		id : asset -> Integer #Trans Ref
		description : asset -> String #Trans Ref
		name : asset -> String #Trans Ref
		strategy_id : asset -> Integer #Ref

		name : strategy -> String #Ref Portfolio
		description : strategy -> String #Ref Portfolio
		id : strategy -> Integer #Ref Portfolio

		name : portfolio -> String #Portfolio
		description : portfolio -> String #Portfolio
		id : portfolio -> Integer #Portfolio
		strategy_id : portfolio -> Integer #Portfolio
		parent_portfolio_id : portfolio -> Integer	#Portfolio ADDED

		quantity : position -> Integer #HoldPos
		current_value : position -> Integer #HoldPos
		cost_basis : position -> Integer #HoldPos
		id : position -> Integer #HoldPos
		client_id : position -> Integer #HoldPos
		asset_id : position -> Integer #HoldPos
		current_value_currency_id : position -> Integer # HoldPos
		cost_basis_currency_id : position -> Integer # HoldPos

		id : holding -> Integer #HoldPos
		asset_id : holding -> Integer #HoldPos
		currency_id : holding -> Integer #HoldPos
		purchase_price : holding -> Double #HoldPos
		quantity : holding -> Integer #HoldPos #HoldPos
		purchase_date : holding -> Date #HoldPos
		begin_date : holding -> Date #HoldPos new attribute
		end_date : holding -> Date #HoldPos new attribute

		description : client -> String #HoldPos
		name : client -> String #HoldPos
		id : client -> Integer #HoldPos

		id : transaction -> Integer #Trans
		asset_id : transaction -> Integer #Trans
		buy_sell_ind : transaction -> Boolean #Trans
		quantity : transaction -> Integer #Trans
		price : transaction -> Double #Trans
		currency_id : transaction -> Integer #Trans
		portfolio_id : transaction -> Integer #Trans
		date : transaction -> Date	#added as a new column

		id : portfolioholding -> Integer #NEW todo: talk to Jee about this
		holding_id : portfolioholding -> Integer #NEW
		client_id : portfolioholding -> Integer #NEW
		portfolio_id : portfolioholding -> Integer #NEW

	observation_equations
		forall p. p.parent.id = p.parent_portfolio_id #added
		forall p. p.portfolio_strategy.id = p.strategy_id
		forall a. a.asset_strategy.id = a.strategy_id
		forall p. p.position_client.id = p.client_id
		forall c. c.currency_country.id = c.country_id
		forall t. t.transaction_currency.id = t.currency_id
		forall t. t.transaction_asset.id = t.asset_id
		forall p. p.portfolioholding_holding.id = p.holding_id
		forall p. p.portfolioholding_client.id = p.client_id
		forall p. p.portfolioholding_portfolio.id = p.portfolio_id
		forall p. p.position_asset.id = p.asset_id
		forall h. h.holding_currency.id = h.currency_id
		forall t. t.transaction_portfolio.id = t.portfolio_id
		forall p. p.position_current_value_currency.id = p.current_value_currency_id
		forall p. p.position_cost_basis_currency.id = p.cost_basis_currency_id
}

####################################

query ETL = literal : getSchema Colimit -> Target {
 entity currency -> {
 		from
 			c:Ref_currency__Trans_currency
		attributes
			code -> c.Ref_currency_code
			name -> c.Ref_currency_name
			id -> c.Ref_currency_id
			country_id -> c.Ref_currency_country_id
		foreign_keys
		 	currency_country -> {c -> c.Ref_currency_country}
}

entity strategy -> {
		from
			s:Portfolio_strategy__Ref_strategy
		attributes
			name -> s.Ref_strategy_name
			description -> s.Ref_strategy_description
			id -> s.Ref_strategy_id
	}

entity	asset -> {
		from
			a:Ref_asset__Trans_asset
		attributes
			id -> a.Ref_asset_id
			description -> a.Ref_asset_description
			name -> a.Ref_asset_name
			strategy_id -> a.Ref_asset_strategy_id
		foreign_keys
		 	asset_strategy -> {s -> a.Ref_asset_strategy}
	}

entity	client -> {
		from
			c:Client_client__HoldPos_client
		attributes
			description -> c.Client_client_description
			name -> c.Client_client_name
			id -> c.Client_client_id
	}

entity	country -> {
		from
			c:Ref_country
		attributes
			code -> c.Ref_country_code
			name -> c.Ref_country_name
			id -> c.Ref_country_id
	}

entity	transaction -> {
		from
			t:Trans_transaction p:Portfolio_portfolio c:Client_client__HoldPos_client c1:Client_client__HoldPos_client
		where
			t.Trans_transaction_portfolio_id = p.Portfolio_portfolio_id
		attributes
			id -> t.Trans_transaction_id
			asset_id -> t.Trans_transaction_asset_id
			buy_sell_ind -> t.Trans_transaction_buy_sell_ind
			quantity -> t.Trans_transaction_quantity
			price -> t.Trans_transaction_price
			date -> t.Trans_transaction_date
			currency_id -> t.Trans_transaction_currency_id
			portfolio_id -> t.Trans_transaction_portfolio_id
		foreign_keys
			transaction_currency -> {c -> t.Trans_transaction_currency}
			transaction_asset -> {a -> t.Trans_transaction_asset}
			transaction_portfolio -> {p -> p} 	#NEW
	}

entity	position -> {
		from
			p:HoldPos_position a:Ref_asset__Trans_asset cv:Ref_currency__Trans_currency cb:Ref_currency__Trans_currency
		where
			p.HoldPos_position_asset_id = a.Ref_asset_id
			p.HoldPos_position_current_value_currency_code = cv.Ref_currency_code
			p.HoldPos_position_cost_basis_currency_code = cb.Ref_currency_code
		attributes
			quantity -> p.HoldPos_position_quantity
			current_value -> p.HoldPos_position_current_value
			cost_basis -> p.HoldPos_position_cost_basis
			id -> p.HoldPos_position_id
			client_id -> p.HoldPos_position_client_no
			asset_id -> p.HoldPos_position_asset_id
			current_value_currency_id -> cv.Ref_currency_id
			cost_basis_currency_id -> cb.Ref_currency_id
 		foreign_keys
		 	position_client -> {c -> p.HoldPos_position_client}
			position_asset -> {a -> a}  #NEW
			position_current_value_currency -> {c -> cv}  #NEW
			position_cost_basis_currency -> {c -> cb}  #NEW
	}

	entity portfolio -> {
		from
			p:Portfolio_portfolio
		attributes
			parent_portfolio_id -> p.Portfolio_portfolio_parent_id #added
			name -> p.Portfolio_portfolio_name
			description -> p.Portfolio_portfolio_description
			id -> p.Portfolio_portfolio_id
			strategy_id -> p.Portfolio_portfolio_strategy_id
		foreign_keys
 			parent -> {p -> p.Portfolio_portfolio_parent}  #added
			portfolio_strategy -> {s -> p.Portfolio_portfolio_strategy}
	}

	entity holding -> {
		from
			h:HoldPos_holding c:Ref_currency__Trans_currency a:Ref_asset__Trans_asset
		where
			a.Ref_asset_id = h.HoldPos_holding_asset_id
			h.HoldPos_holding_currency_code = c.Ref_currency_code
		attributes
			id -> h.HoldPos_holding_id
			asset_id -> h.HoldPos_holding_asset_id
			currency_id -> c.Ref_currency_id
			purchase_price -> h.HoldPos_holding_purchase_price
			quantity -> h.HoldPos_holding_quantity
			purchase_date -> h.HoldPos_holding_purchase_date
			begin_date -> h.HoldPos_holding_begin_date
			end_date -> h.HoldPos_holding_end_date
		foreign_keys
 			holding_asset -> {a -> a}
			holding_currency -> {c -> c}
	}

entity	portfolioholding -> {
		from
			h:HoldPos_holding p:Portfolio_portfolio cur: Ref_currency__Trans_currency c1:Client_client__HoldPos_client a:Ref_asset__Trans_asset
		where
			a.Ref_asset_id = h.HoldPos_holding_asset_id
			p.Portfolio_portfolio_parent.Portfolio_portfolio_client_id = c1.Client_client_id
			c1.Client_client_id = h.HoldPos_holding_client.Client_client_id
			h.HoldPos_holding_currency_code = cur.Ref_currency_code
			p.Portfolio_portfolio_client_id = h.HoldPos_holding_client.Client_client_id
			h.HoldPos_holding_portfolio_id = p.Portfolio_portfolio_id
		attributes
			id -> keygen(h.HoldPos_holding_id, h.HoldPos_holding_client.Client_client_id, p.Portfolio_portfolio_id) #added by ryan
			holding_id -> h.HoldPos_holding_id
			client_id -> c1.Client_client_id
			portfolio_id -> p.Portfolio_portfolio_id
		foreign_keys
			portfolioholding_holding -> {h -> h c -> cur a -> a}
			portfolioholding_client -> {c -> h.HoldPos_holding_client}
			portfolioholding_portfolio -> {p -> p}
	}
}

instance Output = distinct eval ETL E
Keywords:

typeside_literal
sigma
quotient_query
schema_literal
quotient
query_literal
instance_literal
distinct
coproduct

Options:

quotient_use_chase
simplify_names



instance PortfolioInstance

portfolio
IDclient_iddescriptionidnameparent_idstrategy_idparentstrategy
01Portfolio11Port11204
12Portfolio22Port22214
22Portfolio33Port32113
strategy
IDdescriptionidname
3Strategy11Strat1
4Strategy22Strat2
5Strategy33Strat3


instance ClientInstance

client
IDdescriptionidname
0Tom Client1Tom
1Dick Client2Dick
2Harry Client3Harry


instance ClientFwd

Client_client__HoldPos_client
IDClient_client_descriptionClient_client_idClient_client_nameHoldPos_client_descHoldPos_client_nmHoldPos_client_no
0Tom Client1TomTom ClientTom1
1Dick Client2DickDick ClientDick2
2Harry Client3HarryHarry ClientHarry3
HoldPos_holding
IDHoldPos_holding_asset_idHoldPos_holding_begin_dateHoldPos_holding_client_noHoldPos_holding_currency_codeHoldPos_holding_end_dateHoldPos_holding_idHoldPos_holding_portfolio_idHoldPos_holding_purchase_dateHoldPos_holding_purchase_priceHoldPos_holding_quantityHoldPos_holding_client
HoldPos_position
IDHoldPos_position_asset_idHoldPos_position_client_noHoldPos_position_cost_basisHoldPos_position_cost_basis_currency_codeHoldPos_position_current_valueHoldPos_position_current_value_currency_codeHoldPos_position_idHoldPos_position_quantityHoldPos_position_client
Portfolio_portfolio
IDPortfolio_portfolio_client_idPortfolio_portfolio_descriptionPortfolio_portfolio_idPortfolio_portfolio_namePortfolio_portfolio_parent_idPortfolio_portfolio_strategy_idPortfolio_portfolio_parentPortfolio_portfolio_strategy
Portfolio_strategy__Ref_strategy
IDPortfolio_strategy_descriptionPortfolio_strategy_idPortfolio_strategy_nameRef_strategy_descriptionRef_strategy_idRef_strategy_name
Ref_asset__Trans_asset
IDRef_asset_descriptionRef_asset_idRef_asset_nameRef_asset_strategy_idTrans_asset_descriptionTrans_asset_idTrans_asset_nameRef_asset_strategy
Ref_country
IDRef_country_codeRef_country_idRef_country_name
Ref_currency__Trans_currency
IDRef_currency_codeRef_currency_country_idRef_currency_idRef_currency_nameTrans_currency_codeTrans_currency_idTrans_currency_nameRef_currency_country
Trans_transaction
IDTrans_transaction_asset_idTrans_transaction_buy_sell_indTrans_transaction_currency_idTrans_transaction_dateTrans_transaction_idTrans_transaction_portfolio_idTrans_transaction_priceTrans_transaction_quantityTrans_transaction_assetTrans_transaction_currency


instance PortfolioFwd

Client_client__HoldPos_client
IDClient_client_descriptionClient_client_idClient_client_nameHoldPos_client_descHoldPos_client_nmHoldPos_client_no
HoldPos_holding
IDHoldPos_holding_asset_idHoldPos_holding_begin_dateHoldPos_holding_client_noHoldPos_holding_currency_codeHoldPos_holding_end_dateHoldPos_holding_idHoldPos_holding_portfolio_idHoldPos_holding_purchase_dateHoldPos_holding_purchase_priceHoldPos_holding_quantityHoldPos_holding_client
HoldPos_position
IDHoldPos_position_asset_idHoldPos_position_client_noHoldPos_position_cost_basisHoldPos_position_cost_basis_currency_codeHoldPos_position_current_valueHoldPos_position_current_value_currency_codeHoldPos_position_idHoldPos_position_quantityHoldPos_position_client
Portfolio_portfolio
IDPortfolio_portfolio_client_idPortfolio_portfolio_descriptionPortfolio_portfolio_idPortfolio_portfolio_namePortfolio_portfolio_parent_idPortfolio_portfolio_strategy_idPortfolio_portfolio_parentPortfolio_portfolio_strategy
01Portfolio11Port11204
12Portfolio22Port22214
22Portfolio33Port32113
Portfolio_strategy__Ref_strategy
IDPortfolio_strategy_descriptionPortfolio_strategy_idPortfolio_strategy_nameRef_strategy_descriptionRef_strategy_idRef_strategy_name
3Strategy11Strat1Strategy11Strat1
4Strategy22Strat2Strategy22Strat2
5Strategy33Strat3Strategy33Strat3
Ref_asset__Trans_asset
IDRef_asset_descriptionRef_asset_idRef_asset_nameRef_asset_strategy_idTrans_asset_descriptionTrans_asset_idTrans_asset_nameRef_asset_strategy
Ref_country
IDRef_country_codeRef_country_idRef_country_name
Ref_currency__Trans_currency
IDRef_currency_codeRef_currency_country_idRef_currency_idRef_currency_nameTrans_currency_codeTrans_currency_idTrans_currency_nameRef_currency_country
Trans_transaction
IDTrans_transaction_asset_idTrans_transaction_buy_sell_indTrans_transaction_currency_idTrans_transaction_dateTrans_transaction_idTrans_transaction_portfolio_idTrans_transaction_priceTrans_transaction_quantityTrans_transaction_assetTrans_transaction_currency


instance TransInstance

asset
IDdescriptionidname
0Asset11A1
1Asset33A3
2Asset55A5
3Asset77A7
4Asset99A9
currency
IDcodeidname
5USD1US Dollar
6EUR2Euro
7JPY3Japanese Yen
transaction
IDasset_idbuy_sell_indcurrency_iddateidportfolio_idpricequantityassetcurrency
81buy21/1/2011115.5120006
91sell26/1/2011215.510006
103buy19/1/2013322.515015
113sell13/1/2014423.515015
125buy32/1/2013531.620027
135sell37/1/2013631.510027


instance TransFwd

Client_client__HoldPos_client
IDClient_client_descriptionClient_client_idClient_client_nameHoldPos_client_descHoldPos_client_nmHoldPos_client_no
HoldPos_holding
IDHoldPos_holding_asset_idHoldPos_holding_begin_dateHoldPos_holding_client_noHoldPos_holding_currency_codeHoldPos_holding_end_dateHoldPos_holding_idHoldPos_holding_portfolio_idHoldPos_holding_purchase_dateHoldPos_holding_purchase_priceHoldPos_holding_quantityHoldPos_holding_client
HoldPos_position
IDHoldPos_position_asset_idHoldPos_position_client_noHoldPos_position_cost_basisHoldPos_position_cost_basis_currency_codeHoldPos_position_current_valueHoldPos_position_current_value_currency_codeHoldPos_position_idHoldPos_position_quantityHoldPos_position_client
Portfolio_portfolio
IDPortfolio_portfolio_client_idPortfolio_portfolio_descriptionPortfolio_portfolio_idPortfolio_portfolio_namePortfolio_portfolio_parent_idPortfolio_portfolio_strategy_idPortfolio_portfolio_parentPortfolio_portfolio_strategy
Portfolio_strategy__Ref_strategy
IDPortfolio_strategy_descriptionPortfolio_strategy_idPortfolio_strategy_nameRef_strategy_descriptionRef_strategy_idRef_strategy_name
0?0?1?2?0?1?2
1?3?4?5?3?4?5
2?6?7?8?6?7?8
3?9?10?11?9?10?11
4?12?13?14?12?13?14
Ref_asset__Trans_asset
IDRef_asset_descriptionRef_asset_idRef_asset_nameRef_asset_strategy_idTrans_asset_descriptionTrans_asset_idTrans_asset_nameRef_asset_strategy
5Asset11A1?1Asset11A10
6Asset33A3?4Asset33A31
7Asset55A5?7Asset55A52
8Asset77A7?10Asset77A73
9Asset99A9?13Asset99A94
Ref_country
IDRef_country_codeRef_country_idRef_country_name
10?15?16?17
11?18?19?20
12?21?22?23
Ref_currency__Trans_currency
IDRef_currency_codeRef_currency_country_idRef_currency_idRef_currency_nameTrans_currency_codeTrans_currency_idTrans_currency_nameRef_currency_country
13USD?161US DollarUSD1US Dollar10
14EUR?192EuroEUR2Euro11
15JPY?223Japanese YenJPY3Japanese Yen12
Trans_transaction
IDTrans_transaction_asset_idTrans_transaction_buy_sell_indTrans_transaction_currency_idTrans_transaction_dateTrans_transaction_idTrans_transaction_portfolio_idTrans_transaction_priceTrans_transaction_quantityTrans_transaction_assetTrans_transaction_currency
161buy21/1/2011115.51200514
171sell26/1/2011215.5100514
183buy19/1/2013322.5150613
193sell13/1/2014423.5150613
205buy32/1/2013531.6200715
215sell37/1/2013631.5100715


instance HoldPosInstance

client
IDdescnmno
0Tom ClientTom1
1Dick ClientDick2
holding
IDasset_idbegin_dateclient_nocurrency_codeend_dateidportfolio_idpurchase_datepurchase_pricequantityclient
211/1/20111EUR6/1/2011111/1/20115.512000
316/1/20111EUR?0211/1/20115.11000
439/1/20132JPY3/1/2014339/1/20132.51501
552/1/20132USD7/1/2013432/1/20131.62001
657/1/20132USD?1532/1/20131.61001
position
IDasset_idclient_nocost_basiscost_basis_currency_codecurrent_valuecurrent_value_currency_codeidquantityclient
711551EUR550EUR11000
852160JPY170JPY21001


instance RefInstance

asset
IDdescriptionidnamestrategy_idstrategy
0Asset11A1119
1Asset22A2320
2Asset33A3221
3Asset44A4422
4Asset55A5523
5Asset66A6422
6Asset77A7422
7Asset88A8523
8Asset99A9320
9Asset1010A10119
country
IDcodeidname
10AU1Australia
11CH2Switzerland
12CN3China
13EU4European Union
14JP5Japan
15US6United States of America
currency
IDcodecountry_ididnamecountry
16USD61US Dollar15
17EUR42Euro13
18JPY53Japanese Yen14
strategy
IDdescriptionidname
19Strategy11Strat1
20Strategy33Strat3
21Strategy22Strat2
22Strategy44Strat4
23Strategy55Strat5


instance HoldPosFwd

Client_client__HoldPos_client
IDClient_client_descriptionClient_client_idClient_client_nameHoldPos_client_descHoldPos_client_nmHoldPos_client_no
0Tom Client1TomTom ClientTom1
1Dick Client2DickDick ClientDick2
HoldPos_holding
IDHoldPos_holding_asset_idHoldPos_holding_begin_dateHoldPos_holding_client_noHoldPos_holding_currency_codeHoldPos_holding_end_dateHoldPos_holding_idHoldPos_holding_portfolio_idHoldPos_holding_purchase_dateHoldPos_holding_purchase_priceHoldPos_holding_quantityHoldPos_holding_client
211/1/20111EUR6/1/2011111/1/20115.512000
316/1/20111EUR?0211/1/20115.11000
439/1/20132JPY3/1/2014339/1/20132.51501
552/1/20132USD7/1/2013432/1/20131.62001
657/1/20132USD?1532/1/20131.61001
HoldPos_position
IDHoldPos_position_asset_idHoldPos_position_client_noHoldPos_position_cost_basisHoldPos_position_cost_basis_currency_codeHoldPos_position_current_valueHoldPos_position_current_value_currency_codeHoldPos_position_idHoldPos_position_quantityHoldPos_position_client
711551EUR550EUR11000
852160JPY170JPY21001
Portfolio_portfolio
IDPortfolio_portfolio_client_idPortfolio_portfolio_descriptionPortfolio_portfolio_idPortfolio_portfolio_namePortfolio_portfolio_parent_idPortfolio_portfolio_strategy_idPortfolio_portfolio_parentPortfolio_portfolio_strategy
Portfolio_strategy__Ref_strategy
IDPortfolio_strategy_descriptionPortfolio_strategy_idPortfolio_strategy_nameRef_strategy_descriptionRef_strategy_idRef_strategy_name
Ref_asset__Trans_asset
IDRef_asset_descriptionRef_asset_idRef_asset_nameRef_asset_strategy_idTrans_asset_descriptionTrans_asset_idTrans_asset_nameRef_asset_strategy
Ref_country
IDRef_country_codeRef_country_idRef_country_name
Ref_currency__Trans_currency
IDRef_currency_codeRef_currency_country_idRef_currency_idRef_currency_nameTrans_currency_codeTrans_currency_idTrans_currency_nameRef_currency_country
Trans_transaction
IDTrans_transaction_asset_idTrans_transaction_buy_sell_indTrans_transaction_currency_idTrans_transaction_dateTrans_transaction_idTrans_transaction_portfolio_idTrans_transaction_priceTrans_transaction_quantityTrans_transaction_assetTrans_transaction_currency


instance RefFwd

Client_client__HoldPos_client
IDClient_client_descriptionClient_client_idClient_client_nameHoldPos_client_descHoldPos_client_nmHoldPos_client_no
HoldPos_holding
IDHoldPos_holding_asset_idHoldPos_holding_begin_dateHoldPos_holding_client_noHoldPos_holding_currency_codeHoldPos_holding_end_dateHoldPos_holding_idHoldPos_holding_portfolio_idHoldPos_holding_purchase_dateHoldPos_holding_purchase_priceHoldPos_holding_quantityHoldPos_holding_client
HoldPos_position
IDHoldPos_position_asset_idHoldPos_position_client_noHoldPos_position_cost_basisHoldPos_position_cost_basis_currency_codeHoldPos_position_current_valueHoldPos_position_current_value_currency_codeHoldPos_position_idHoldPos_position_quantityHoldPos_position_client
Portfolio_portfolio
IDPortfolio_portfolio_client_idPortfolio_portfolio_descriptionPortfolio_portfolio_idPortfolio_portfolio_namePortfolio_portfolio_parent_idPortfolio_portfolio_strategy_idPortfolio_portfolio_parentPortfolio_portfolio_strategy
Portfolio_strategy__Ref_strategy
IDPortfolio_strategy_descriptionPortfolio_strategy_idPortfolio_strategy_nameRef_strategy_descriptionRef_strategy_idRef_strategy_name
0Strategy11Strat1Strategy11Strat1
1Strategy33Strat3Strategy33Strat3
2Strategy22Strat2Strategy22Strat2
3Strategy44Strat4Strategy44Strat4
4Strategy55Strat5Strategy55Strat5
Ref_asset__Trans_asset
IDRef_asset_descriptionRef_asset_idRef_asset_nameRef_asset_strategy_idTrans_asset_descriptionTrans_asset_idTrans_asset_nameRef_asset_strategy
5Asset11A11Asset11A10
6Asset22A23Asset22A21
7Asset33A32Asset33A32
8Asset44A44Asset44A43
9Asset55A55Asset55A54
10Asset66A64Asset66A63
11Asset77A74Asset77A73
12Asset88A85Asset88A84
13Asset99A93Asset99A91
14Asset1010A101Asset1010A100
Ref_country
IDRef_country_codeRef_country_idRef_country_name
15AU1Australia
16CH2Switzerland
17CN3China
18EU4European Union
19JP5Japan
20US6United States of America
Ref_currency__Trans_currency
IDRef_currency_codeRef_currency_country_idRef_currency_idRef_currency_nameTrans_currency_codeTrans_currency_idTrans_currency_nameRef_currency_country
21USD61US DollarUSD1US Dollar20
22EUR42EuroEUR2Euro18
23JPY53Japanese YenJPY3Japanese Yen19
Trans_transaction
IDTrans_transaction_asset_idTrans_transaction_buy_sell_indTrans_transaction_currency_idTrans_transaction_dateTrans_transaction_idTrans_transaction_portfolio_idTrans_transaction_priceTrans_transaction_quantityTrans_transaction_assetTrans_transaction_currency


instance CoProd

Client_client__HoldPos_client
IDClient_client_descriptionClient_client_idClient_client_nameHoldPos_client_descHoldPos_client_nmHoldPos_client_no
0Tom Client1TomTom ClientTom1
1Dick Client2DickDick ClientDick2
2Harry Client3HarryHarry ClientHarry3
3Tom Client1TomTom ClientTom1
4Dick Client2DickDick ClientDick2
HoldPos_holding
IDHoldPos_holding_asset_idHoldPos_holding_begin_dateHoldPos_holding_client_noHoldPos_holding_currency_codeHoldPos_holding_end_dateHoldPos_holding_idHoldPos_holding_portfolio_idHoldPos_holding_purchase_dateHoldPos_holding_purchase_priceHoldPos_holding_quantityHoldPos_holding_client
511/1/20111EUR6/1/2011111/1/20115.512003
616/1/20111EUR?0211/1/20115.11003
739/1/20132JPY3/1/2014339/1/20132.51504
852/1/20132USD7/1/2013432/1/20131.62004
957/1/20132USD?1532/1/20131.61004
HoldPos_position
IDHoldPos_position_asset_idHoldPos_position_client_noHoldPos_position_cost_basisHoldPos_position_cost_basis_currency_codeHoldPos_position_current_valueHoldPos_position_current_value_currency_codeHoldPos_position_idHoldPos_position_quantityHoldPos_position_client
1011551EUR550EUR11003
1152160JPY170JPY21004
Portfolio_portfolio
IDPortfolio_portfolio_client_idPortfolio_portfolio_descriptionPortfolio_portfolio_idPortfolio_portfolio_namePortfolio_portfolio_parent_idPortfolio_portfolio_strategy_idPortfolio_portfolio_parentPortfolio_portfolio_strategy
121Portfolio11Port1121216
132Portfolio22Port2221316
142Portfolio33Port3211315
Portfolio_strategy__Ref_strategy
IDPortfolio_strategy_descriptionPortfolio_strategy_idPortfolio_strategy_nameRef_strategy_descriptionRef_strategy_idRef_strategy_name
15Strategy11Strat1Strategy11Strat1
16Strategy22Strat2Strategy22Strat2
17Strategy33Strat3Strategy33Strat3
18Strategy11Strat1Strategy11Strat1
19Strategy33Strat3Strategy33Strat3
20Strategy22Strat2Strategy22Strat2
21Strategy44Strat4Strategy44Strat4
22Strategy55Strat5Strategy55Strat5
23?2?3?4?2?3?4
24?5?6?7?5?6?7
25?8?9?10?8?9?10
26?11?12?13?11?12?13
27?14?15?16?14?15?16
Ref_asset__Trans_asset
IDRef_asset_descriptionRef_asset_idRef_asset_nameRef_asset_strategy_idTrans_asset_descriptionTrans_asset_idTrans_asset_nameRef_asset_strategy
28Asset11A11Asset11A118
29Asset22A23Asset22A219
30Asset33A32Asset33A320
31Asset44A44Asset44A421
32Asset55A55Asset55A522
33Asset66A64Asset66A621
34Asset77A74Asset77A721
35Asset88A85Asset88A822
36Asset99A93Asset99A919
37Asset1010A101Asset1010A1018
38Asset11A1?3Asset11A123
39Asset33A3?6Asset33A324
40Asset55A5?9Asset55A525
41Asset77A7?12Asset77A726
42Asset99A9?15Asset99A927
Ref_country
IDRef_country_codeRef_country_idRef_country_name
43AU1Australia
44CH2Switzerland
45CN3China
46EU4European Union
47JP5Japan
48US6United States of America
49?17?18?19
50?20?21?22
51?23?24?25
Ref_currency__Trans_currency
IDRef_currency_codeRef_currency_country_idRef_currency_idRef_currency_nameTrans_currency_codeTrans_currency_idTrans_currency_nameRef_currency_country
52USD61US DollarUSD1US Dollar48
53EUR42EuroEUR2Euro46
54JPY53Japanese YenJPY3Japanese Yen47
55USD?181US DollarUSD1US Dollar49
56EUR?212EuroEUR2Euro50
57JPY?243Japanese YenJPY3Japanese Yen51
Trans_transaction
IDTrans_transaction_asset_idTrans_transaction_buy_sell_indTrans_transaction_currency_idTrans_transaction_dateTrans_transaction_idTrans_transaction_portfolio_idTrans_transaction_priceTrans_transaction_quantityTrans_transaction_assetTrans_transaction_currency
581buy21/1/2011115.512003856
591sell26/1/2011215.51003856
603buy19/1/2013322.51503955
613sell13/1/2014423.51503955
625buy32/1/2013531.62004057
635sell37/1/2013631.51004057


instance E

Client_client__HoldPos_client
IDClient_client_descriptionClient_client_idClient_client_nameHoldPos_client_descHoldPos_client_nmHoldPos_client_no
0Tom Client1TomTom ClientTom1
1Dick Client2DickDick ClientDick2
2Harry Client3HarryHarry ClientHarry3
HoldPos_holding
IDHoldPos_holding_asset_idHoldPos_holding_begin_dateHoldPos_holding_client_noHoldPos_holding_currency_codeHoldPos_holding_end_dateHoldPos_holding_idHoldPos_holding_portfolio_idHoldPos_holding_purchase_dateHoldPos_holding_purchase_priceHoldPos_holding_quantityHoldPos_holding_client
311/1/20111EUR6/1/2011111/1/20115.512000
416/1/20111EUR?0211/1/20115.11000
539/1/20132JPY3/1/2014339/1/20132.51501
652/1/20132USD7/1/2013432/1/20131.62001
757/1/20132USD?1532/1/20131.61001
HoldPos_position
IDHoldPos_position_asset_idHoldPos_position_client_noHoldPos_position_cost_basisHoldPos_position_cost_basis_currency_codeHoldPos_position_current_valueHoldPos_position_current_value_currency_codeHoldPos_position_idHoldPos_position_quantityHoldPos_position_client
811551EUR550EUR11000
952160JPY170JPY21001
Portfolio_portfolio
IDPortfolio_portfolio_client_idPortfolio_portfolio_descriptionPortfolio_portfolio_idPortfolio_portfolio_namePortfolio_portfolio_parent_idPortfolio_portfolio_strategy_idPortfolio_portfolio_parentPortfolio_portfolio_strategy
101Portfolio11Port1121014
112Portfolio22Port2221114
122Portfolio33Port3211113
Portfolio_strategy__Ref_strategy
IDPortfolio_strategy_descriptionPortfolio_strategy_idPortfolio_strategy_nameRef_strategy_descriptionRef_strategy_idRef_strategy_name
13Strategy11Strat1Strategy11Strat1
14Strategy22Strat2Strategy22Strat2
15Strategy33Strat3Strategy33Strat3
16Strategy55Strat5Strategy55Strat5
17Strategy44Strat4Strategy44Strat4
Ref_asset__Trans_asset
IDRef_asset_descriptionRef_asset_idRef_asset_nameRef_asset_strategy_idTrans_asset_descriptionTrans_asset_idTrans_asset_nameRef_asset_strategy
18Asset11A11Asset11A113
19Asset33A32Asset33A314
20Asset55A55Asset55A516
21Asset77A74Asset77A717
22Asset99A93Asset99A915
23Asset22A23Asset22A215
24Asset44A44Asset44A417
25Asset66A64Asset66A617
26Asset88A85Asset88A816
27Asset1010A101Asset1010A1013
Ref_country
IDRef_country_codeRef_country_idRef_country_name
28US6United States of America
29EU4European Union
30JP5Japan
31AU1Australia
32CH2Switzerland
33CN3China
Ref_currency__Trans_currency
IDRef_currency_codeRef_currency_country_idRef_currency_idRef_currency_nameTrans_currency_codeTrans_currency_idTrans_currency_nameRef_currency_country
34USD61US DollarUSD1US Dollar28
35EUR42EuroEUR2Euro29
36JPY53Japanese YenJPY3Japanese Yen30
Trans_transaction
IDTrans_transaction_asset_idTrans_transaction_buy_sell_indTrans_transaction_currency_idTrans_transaction_dateTrans_transaction_idTrans_transaction_portfolio_idTrans_transaction_priceTrans_transaction_quantityTrans_transaction_assetTrans_transaction_currency
371buy21/1/2011115.512001835
381sell26/1/2011215.51001835
393buy19/1/2013322.51501934
403sell13/1/2014423.51501934
415buy32/1/2013531.62002036
425sell37/1/2013631.51002036


instance Output

asset
IDdescriptionidnamestrategy_idasset_strategy
0Asset11A1137
1Asset33A3238
2Asset55A5540
3Asset77A7441
4Asset99A9339
5Asset22A2339
6Asset44A4441
7Asset66A6441
8Asset88A8540
9Asset1010A10137
client
IDdescriptionidname
10Tom Client1Tom
11Dick Client2Dick
12Harry Client3Harry
country
IDcodeidname
13US6United States of America
14EU4European Union
15JP5Japan
16AU1Australia
17CH2Switzerland
18CN3China
currency
IDcodecountry_ididnamecurrency_country
19USD61US Dollar13
20EUR42Euro14
21JPY53Japanese Yen15
holding
IDasset_idbegin_datecurrency_idend_dateidpurchase_datepurchase_pricequantityholding_assetholding_currency
2211/1/201126/1/201111/1/20115.51200020
2316/1/20112?021/1/20115.1100020
2439/1/201333/1/201439/1/20132.5150121
2552/1/201317/1/201342/1/20131.6200219
2657/1/20131?152/1/20131.6100219
portfolio
IDdescriptionidnameparent_portfolio_idstrategy_idparentportfolio_strategy
27Portfolio11Port1122738
28Portfolio22Port2222838
29Portfolio33Port3212837
portfolioholding
IDclient_idholding_ididportfolio_idportfolioholding_clientportfolioholding_holdingportfolioholding_portfolio
301151102227
311201102327
322323112429
332473112529
342543112629
position
IDasset_idclient_idcost_basiscost_basis_currency_idcurrent_valuecurrent_value_currency_ididquantityposition_assetposition_clientposition_cost_basis_currencyposition_current_value_currency
35115512550211000102020
36521603170321002112121
strategy
IDdescriptionidname
37Strategy11Strat1
38Strategy22Strat2
39Strategy33Strat3
40Strategy55Strat5
41Strategy44Strat4
transaction
IDasset_idbuy_sell_indcurrency_iddateidportfolio_idpricequantitytransaction_assettransaction_currencytransaction_portfolio
421buy21/1/2011115.5120002027
431sell26/1/2011215.510002027
443buy19/1/2013322.515011928
453sell13/1/2014423.515011928
465buy32/1/2013531.620022129
475sell37/1/2013631.510022129