none
Quickest way to parse a 3D datatable using LINQ RRS feed

  • Question

  • I have a fairly large database comprising of over 800k records for a large retail company

    The records (rows) contain various info, however there are 3 fields (columns) that I need to parse through in order to establish trends, averages, min and max sales on:

    • Store Number
    • SKU
    • Sales QTY

    First I do a LINQ group query in order to get a list of stores. No problem here, works very quickly

    Then I do the same with the products and get a list of all the products through a LINQ query

    I then do nested foreach loops to parse through each store, each product and then a LINQ query to get the sales history for the specific product.

    I then loop through the sales history to establish min, max and average sales, trends as well as stock levels.

    This all works well except that when working with 800k records there is over 4 million iterations thru the data. Not very efficient.

    What are your suggestions (LINQ) to get the sales history by week, by SKU and by store more efficiently and more quickly?

    Look forward to your ideas.

    Bob

    Wednesday, December 9, 2015 3:47 PM

Answers

All replies

  • Hi Bob,

    Since your question is about ADO.NET Entity Framework and LINQ to Entities. I moved it to that forum.

    Thanks for your understanding.

    Best Regards,

    Lake Xiao

    Friday, December 11, 2015 6:00 AM
  • you could use join action by product Id


    DON'T TRY SO HARD,THE BEST THINGS COME WHEN YOU LEAST EXPECT THEM TO.


    Sunday, December 13, 2015 8:33 AM