[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Combining group results in Reporting Services Part 2

Posted on 2008-06-25
2
Medium Priority
?
216 Views
Last Modified: 2010-04-21
I am creating a report that displays multiple demographics of employees who do or do not utilize direct deposit.   One of the groups (UNION_CODE) returns 6 items: (NULL), Union1, Union2, Union3-Service, Union3-Skilled, Union3-Tech and then reports how many in each group has direct deposit, does not have direct deposit, or partially uses direct deposit.

I've been asked to combine the results to show only 3 groups:

1. Union1
2. Union3 (Service, Skilled, & Tech)
3. "Everyone else" ((NULL) and Union2)

Any ideas on how to do this either in the SQL query dataset or in the report layout (or anywhere else)?
SELECT        EMPLOYEE, LAST_NAME, FIRST_NAME, DEPARTMENT, 
                         PROCESS_LEVEL, TERM_DATE, SCHEDULE, EMP_STATUS, 
                         UNION_CODE, "COALESCE"(AUTO_DEPOSIT, 'N') 
                         AS AUTO_DEPOSIT
FROM            LAWSON.EMPLOYEE
WHERE        (TERM_DATE = '01-JAN-1700')

Open in new window

0
Comment
Question by:thehollis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
jgv earned 1000 total points
ID: 21867971
SELECT      EMPLOYEE, LAST_NAME, FIRST_NAME, DEPARTMENT,
      PROCESS_LEVEL, TERM_DATE, SCHEDULE, EMP_STATUS,
      UNION_CODE, COALESCE(AUTO_DEPOSIT, 'N') AS AUTO_DEPOSIT,
      CASE
          WHEN UNION_CODE = 'Union1' THEN 'Union1'    
          WHEN UNION_CODE LIKE 'Union3%' THEN 'Union3'
          WHEN UNION_CODE IS NULL OR UNION_CODE = 'Union2' THEN 'Everyone Else'
      END AS UnionCodeGrouping
FROM            LAWSON.EMPLOYEE
WHERE        (TERM_DATE = '01-JAN-1700')
0
 

Author Closing Comment

by:thehollis
ID: 31470670
Thank you very much!!!  I am still learning SQL and have not encountered CASE yet...now I will seek it out.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question