Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8315441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:07:54+00:00 2026-06-08T21:07:54+00:00

I m having data in columns as: – Process Volume TAT 1 1 Pass

  • 0

I m having data in columns as: –

  Process   Volume      TAT
  1            1        Pass
  1            2        Fail
  2            5        Fail
  2            5        Pass
  3            1        Pass
  4            6        Fail
  4            4        Pass

Now grouping by Process, i want the sum of volume (not taking into account whatever TAT), sum of volume where TAT = Pass, sum of Volume where TAT = Fail.

Like this

Process     Total Volume    Volume(TAT=Pass)    Volume(TAT = Fail)
1           3               1                   2
2           10              5                   5
...
...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:07:55+00:00Added an answer on June 8, 2026 at 9:07 pm

    For SQL Server, you can use CASE expressions to conditionally determine the amount you need to add, then SUM them together, like this:

    SELECT Process, SUM(Volume) AS TotalVolume, 
        SUM(CASE WHEN TAT = 'Pass' THEN Volume ELSE 0 END) AS Pass,
        SUM(CASE WHEN TAT = 'Fail' THEN Volume ELSE 0 END) AS Fail
    FROM (
         -- Dummy data here for testing
        SELECT 1 AS Process, 1 as Volume, 'Pass' AS TAT
        UNION SELECT 1, 2, 'Fail'
        UNION SELECT 2, 5, 'Fail'
        UNION SELECT 2, 5, 'Pass'
        UNION SELECT 3, 1, 'Pass'
        UNION SELECT 4, 6, 'Fail'
        UNION SELECT 4, 4, 'Pass'
    ) MyTable
    GROUP BY Process
    ORDER BY Process
    

    For Microsoft Access, CASE isn’t supported, so you can use SWITCH or IIF, like so:

    SUM(IIF(TAT = 'Pass', Volume, 0)) AS Pass
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic json data having the format var cols= { columns :
I have often heard complaints against Java for not having unsigned data types. See
I want to visually represent my data in columns, rather than the row representation
Grid View Data Bind i have a database table with 4 columns having data
I am using a text file that stores 3 columns of data, each having
I'm having a bit of trouble with entering data into several columns of a
I'm using telerik mvc grid and bound my columns throuugh Data Table, I having
I want to retrieve data from 2 columns of my database table and bind
I have a large data frame with 48 columns, and I want to run
I'm having trouble inserting data from one column to another within the same table.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.