Cum() returns an array, always. Cum() just adds each element of the input array. So, if you pass my_array, it will return an array where each element of the result is the sum of all my_array elements up to that point.
In your first example; > it_array[0] = 1; > it_array[1] = 13333; > it_array[2] = 133; > it_array[3] = Null; > > zl_1 = 0; > it_vergleich = it_array >= 1; > zl_1 = Cum(it_vergleich) ; > ----->> leads to the result: 3 !!!. Yes, because it_array[0], it_array[1] and it_array[2] are all greater than 1. If you wanted to add the values of it_array, then pass it_array directly, instead of on the boolean result of (it_array >= 1). > it_vergleich = it_array >= 0; > ----->> leads to the result: 4581 !!!. clicking around in the chart, > changes this number, maybe this reflects "QuickAFL" Thing. The it_array has all zero values for the non initialized elements. So, the count for >= 0 is true for all bars. Add a Plot of it_array to see. > it_array[0] = 1; > it_array[1] = 13333; > it_array[2] = Null; > it_array[3] = 133; > > zl_1 = 0; > it_vergleich = it_array >= 1; > zl_1 = Cum(it_vergleich) ; > > ----->> leads to the result: 3 what a wonder !!! but this isn`t true for > the array ... It is true. For the same reason that the first example is true. The boolean expression (it_array >= 1) is true 3 times. Thus the result is [0] = 1 [1] = 2 [2] = 2 [3] = 3 [4] = 3 ... [BarCount -1] = 3. If you want to add the values of it_array, ignoring Null, do the following: z1_1 = Cum(NZ(it_array)); Plot(z1_1, "Cum(it_array)", colorBlue, styleLine); Mike --- In [email protected], "schnitt_tt" <schnitt...@...> wrote: > > thanks for answering, but maybe i`m not understanding the cum() function: > > a) does cum() returns a array or number ? > maybe when use it like cum(1) it returns a number, but this > can only used for the "chart-array" > when using it like cum( my_array ) it returns an array > like in the Help-Files said. ??? > > > it_array[0] = 1; > it_array[1] = 13333; > it_array[2] = 133; > it_array[3] = Null; > > zl_1 = 0; > it_vergleich = it_array >= 1; > zl_1 = Cum(it_vergleich) ; > ----->> leads to the result: 3 !!!. > > > it_vergleich = it_array >= 0; > ----->> leads to the result: 4581 !!!. clicking around in the chart, > changes this number, maybe this reflects "QuickAFL" Thing. > > -----> Entry with zero Value Problem <---------- > > it_array[0] = 1; > it_array[1] = 13333; > it_array[2] = Null; > it_array[3] = 133; > > zl_1 = 0; > it_vergleich = it_array >= 1; > zl_1 = Cum(it_vergleich) ; > > ----->> leads to the result: 3 what a wonder !!! but this isn`t true for > the array ... >
