Results 1 to 15 of 15

SUM Values based off Lookup Table

Threaded View

  1. #1
    Registered User
    Join Date
    04-20-2005
    Posts
    48

    SUM Values based off Lookup Table

    I'd like to SUM all values in DATA TABLE col_b where DATA TABLE col_a has a value of MED in the LOOKUP TABLE.

    For example using the tables below..
    I want to sum col_b in the data table for all Cat# that have a lookup of HIGH. This would be Cat1, Cat2, and Cat5. Thus, equalling: 5+3+9+8 = 25

    Any ideas on how to get this to work?

    LOOKUP TABLE
        col_a    col_b
        Cat2     HIGH
        Cat5     HIGH
        Cat3     MED
        Cat4     LOW
        Cat1     HIGH
    DATA TABLE
        col_a   col_b
        Cat1     5
        Cat1     3
        Cat3     8
        Cat1     9
        Cat5     1
        Cat4     3
        Cat2     8 
        Cat3     3
    Thanks,
    JC
    Last edited by carlyman; 08-18-2011 at 09:10 AM. Reason: Showing that lookup table will be unordered

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1