Joined: 23 Oct 2012
Online Status: Offline
Posts: 17
Topic: Adding another data set to an array Posted: 30 Mar 2014 at 7:27am
Hi All,
I'm trying to add in the terminal value number to array and am having difficulty. I'm using this array for an XIRR calc. XIRR calc's in crystal require a value and a date array set up. In this calculation, I need net contributions/distributions (which have 34 records) and then I need to add to the value/date section the terminal value which is only one number.
The formula I'm using (below) works, but it duplicates the first number in the array.
//append arrays with terminal value
if onlastrecord then
(
x:= x + 1;
redim preserve d[x];
redim preserve n[x];
d[x]:= DateValue({PCAP.GL Date});
n[x]:= ToNumber({PCAP.Ending Capital});
);
The only logic that I think would remove the duplicate is by saying that IF NetContrib/Dist = NEXT Contrib Distib and GL Date = Next GL Date, then suppress. To be honest though, my array skills are very limited.
Does anyone have any thoughts on how to do this? I'd greatly appreciate it!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum