paulyoder / LinqToExcel

Use LINQ to retrieve data from spreadsheets and csv files
MIT License
1.06k stars 299 forks source link

Issue When selecting #119

Closed forReason closed 7 years ago

forReason commented 7 years ago

I have a weird issue which I totally not understand. Maybe I'm missing something.

var excel = new ExcelQueryFactory("products.xlsx");
//get all products with discount
var discounts = from s in excel.Worksheet() where
    s["Discount/Premium"].Cast<string>().StartsWith("-") select s;
//Select products with a YTM higher than 3
var applicable = from b in discounts where 
    b["YTM"].Cast<double>() > 3.0 select b;
MessageBox.Show(discounts.Count().ToString()); //<- returns 51
MessageBox.Show(applicable.Count().ToString()); //<- returns 14826

To my my knowledge, I'm searching YTM products in discounts. How can I get 14'000 products from 51?!? Am I missing something?

Best regards, Julian

mrworkman commented 7 years ago

This sounds like the same issue as #120.