Forum Replies Created

Viewing 15 posts - 721 through 735 (of 5,502 total)

  • RE: Eliminating group by repetition

    I think I finally understood what you're looking for...

    Will this be closer?

    ;

    WITH cte AS

    (

    SELECT

    LOB,

    [Period] = [App Week],

    [Bin Type] = BinTypes.BinType,

    [Bin] = -- one row per original temp table

    CASE

    WHEN...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Eliminating group by repetition

    Would you please change the sample data you posted to reflect the columns you're using in your latest reply (e.g. [Homeowner Bin])?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Eliminating group by repetition

    The problem you describe seems to different to the code you've posted.

    In the code provided the two sections don't have enough in common: one is using the CUBE operator whereas...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Eliminating group by repetition

    Here's the "straight forward" approach without the temp tables:

    ;

    WITH cte AS

    (

    SELECT

    LOB,

    [Period] = [App Week],

    [Bin Type] = 'Time to Fund',

    [Bin] = [Time to Fund Bin],

    Applications = SUM(Applications)

    FROM #APPS AS a

    GROUP BY

    a.LOB,

    [App...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Eliminating group by repetition

    I think there's an easier solution to do it. But I'd like to test it before posting to make sure the code works as intended.

    Therefore I'd like you to provide...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: query for graph

    Are you looking for something along those lines?

    ;

    WITH cte AS

    (

    SELECT CAST(impressionDate AS DATE) AS supplier_date, count(*) AS impression_cnt

    FROM [tbl_supplier_impressions]

    GROUP BY CAST(impressionDate AS DATE)

    ),

    cte2 AS

    (

    SELECT ...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: query for graph

    Based on your expected output requested eariler:

    date | impressions | clicks | supplier id

    12/2011 | 10 | 2 | guid

    11/2011 | 8 | 5 | guid

    10/2011 | 20 | 4...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: query for graph

    Based on your sampe data, what would be your expected result?

    It's partially unclear since your expected result is grouped by month but also showing supplierid as part of the result...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: query for graph

    In that article is a section describing how to insert sample data (INSERT INTO ... SELECT) 😉



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: query for graph

    As mentioned earlier: please read and follow the advice given in the first article in my signature.

    We're all volunteers here trying to help. So it would be great if you...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Better option?

    A reference table with UserId and ItemsId (both integer values) with a clustered index on UserId and ItemsId should be easy enough to query and should perform pretty good (assuming...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: query for graph

    Please provide DDL and sample data as well as expected output and what you've tried so far.

    For a detailed description on how to provide data in a ready to use...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: query for chart

    duplicate post. no replies please (see original post)



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Update XML attribute value using another XML attribute value

    What does the other xml file look like and what value/attribute do you need to extract from it?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Update XML attribute value using another XML attribute value

    Here's a solution based on Jacobs XML Lab.

    It need to be noticeed that this will modify only one attribute. If you need to modify more/all attributes and the xml structure...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 15 posts - 721 through 735 (of 5,502 total)