Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading an Array question

Status
Not open for further replies.

JasonKaufman

Programmer
Apr 13, 2006
46
US
Hi,

I am drilling into a table in our software and the field is an array. I am using Crystal XI.

The data held there is sales numbers for each month. I want to be able to for any month of my choosing be able to pull the data that relates to that particular month. So in the data below, if I wanted the sales for April, I would get as a result 35865.9.

0;0;0;35865.9;68436.95;0;0;0;0;0;0;0;0

I will be manipulating that data to determine margins and cost of goods, so would need to be able to use this Array Read in formulas too.

Thanks for your help!
 
Crystal will probably not see it as an array, provided it is in Month order and always delimited with ;

@April
local stringvar array x;
x:=split({your field}, ";");
tonumber(x[4]);

Repeat for other months

Ian
 
Thanks Ian!

This works perfectly.

I went a step further and created a parameter that I stuck in the formula so I could select which month I wanted for my report.

local stringvar array x;
x:=split({oe_hist_cust.dollars-shipped}, ";");
tonumber(x[{?Month Selection}]);

Thank you so much!

Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top