Forum Replies Created

Viewing 12 posts - 121 through 132 (of 132 total)

  • RE: Conditional Aggregation

    Length (it should actually be [interval] thickness rather than length - My bad on the naming) weighted average is calculated like this;

    ((Prev.MBit * Prev.Length)

    + (Cur.MBit * Cur.Length)

    + (Nex.MBit * Nex.Length))

    /(Prev.Length...

  • RE: Conditional Aggregation

    I'm not sure what you mean by bound by. If you mean that I can join the table to it's self like this

    FROM ##TEMP CUR

    LEFT JOIN ##TEMP PREV

    ON...

  • RE: Conditional Aggregation

    The table I'm working with is acutally a temporary table I've created from the source data which has been quite processed to get it to this point.

    The table definition below...

  • RE: Conditional Aggregation

    Ah. I should just mention that in the assembled intervals PNG the 2nd example is a case where there would be recursion. The first three records would be...

  • RE: Aggregating records representing ranges

    FYI...

    The total time for my process now has gone from ~ 4:30 to ~ 1:00!

    Now that's performance!

  • RE: Aggregating records representing ranges

    I've got it!

    The problem was in the order of the set statements.

    Because @currrange_start and @currrange_end rely on the value of @currfile, setting @currfile to the value of the current record...

  • RE: Aggregating records representing ranges

    Apparently the answer is in the details. Thanks again for spending time on this. Unfortunately, it's still not quite there.

    The code seems to work correctly if I use...

  • RE: Aggregating records representing ranges

    Thank you for your thoughts and effort on this.

    Your answer seems oh so close and it certainly is fast! However, it doesn't quite work the way I need it...

  • RE: Aggregating records representing ranges

    Hi. I'm presently using this solution to my problem and it does indeed work. The only drawback is that it takes a long time.

    This code bit is the...

  • RE: Smallest value of three columns

    That's it! Thanks.

  • RE: Update a field with Stored Procedure output

    If I understand the problem properly I think that this would work.

    SELECT

    IDENTITY(INT,) AS pKey

    ,*

    INTO ##T1

    FROM [YOUR TABLE]

    This will give you a temporary table with pKeys

    Then you...

  • RE: Aggregating records representing ranges

    Is it wrong to use code you don't understant? 😉

    It'll take me a little while to figure out exactly what this does but it does indeed work.

    Thanks so much!

Viewing 12 posts - 121 through 132 (of 132 total)