2 Replies Latest reply: Apr 25, 2013 4:09 AM by li123456

# linest_m() and aggr() problem

Hello!

I have problem with my calculate linest_m. I present my conditions as follows:

1. a. I have the following fonction: y = y(t),       where t is the x axe, and y(t)= count(TYPE)
2. b. I want to calculate the cumulate result Y = ∑y(t)
3. b. The regression line is defined between t1 and t2 ,    where  t1 and t2 are two variables.
4. c. I need to calculate the linest_m and linest_b of the regression line,  where t should be between t1 and t2.

Anyhow, the result should be always defined by a subset of (t1,t2).

THANKS for you response!!

Actually, I think the problem is how to do a cumulate calculation in an aggr() function, correctly.

• ###### Re: linest_m() and aggr() problem

Not sure why it's not working but this line is wrong

count({<DT_hhmm_05={">=\$(vDtMin)"}*{"<=\$(vDtMax)"},TYPE=SEL_01>}TYPE)

it should be something like is SEL_01 a field or a value? if it's a filed it should be

count({<DT_hhmm_05={">=\$(vDtMin)"}*{"<=\$(vDtMax)"},TYPE=P(SEL_01)>}TYPE)

Also, you're filtering values with an IF statement but also using set analysis. I also don't believe rowno or above will work with the AGGR function.

You should try building a sample application so people here might be able to help you.

• ###### Re: linest_m() and aggr() problem

So I modified my question as above, and this is the exact context of my problem. .. If you have any idea, thx so much for your response!