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

  • SEARCH
  • Home
  • 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 8072625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:04:46+00:00 2026-06-05T14:04:46+00:00

for reporting purposes i wanna split a list of purchase orders into multiple lists.

  • 0

for reporting purposes i wanna split a list of purchase orders into multiple lists. One list for each purchase address. I know it’s possible to group the list by purchase address, but my question is how to split the list by this purchase address into multiple lists and use these multiple list to create individual reporting files.

code:

(from o in orders
group o by new {field1, field2, field3, field4} into og
orderby og.Key.field1
select new ViewClass
{
    purchaseAddress = og.Key.field1,
    product = og.key.field2,
    count = og.count
}).ToList()

question: how to split above list into multiple lists for each purchaseAddress?

  • 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-05T14:04:47+00:00Added an answer on June 5, 2026 at 2:04 pm

    There’s a built-in function that I think does what you want. If I assume that your code is assigned to a variable called query then you can write this:

    ILookup<string, ViewClass> queryLists = query.ToLookup(x => x.purchaseAddress);
    

    This essentially creates a list of lists that you access like a dictionary, except that each value is a list of zero or more values. Something like:

    IEnumerable<ViewClass> someList = queryLists["Some Address"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We import data from our clients into our central server for reporting purposes. We
Looking into org.pentaho.reporting.engine.classic.core.DataFactory and more specifically into the initialize method (which was formerly part
We have a reporting solution that works like this. User orders the report to
My app consolidates data from other DBs for reporting purposes. We can't link the
When building data marts for reporting purposes (using dimensional modelling), what data types should
I'm using JasperReports for reporting purposes with JasperServer . There is a database in
I'd like to handle entries for reporting purposes even if the entries are deleted.
I want to compile the data for reporting purpose, using php communicating with postgres,
Scenario: Reporting services installed in Sharepoint integrated mode. I have 2 reports: Report A
I am building a reporting tool and I need to execute queries on remote

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.