I have the following drawback, I am obtaining the list of brands that belong to a certain company through a linq, but I must organize them according to the order in which each brand has been sold (descending)
This is the linq and the column that contains the sales values of each brand is called “Ventas Netas Act”
(From z In dtFinal.AsEnumerable Where z(“Sociedad”).ToString.Trim.Equals(“Ind Colombiana Cafe S.A.S”) Select (z(“LINEA NUEVA”))).Distinct.ToList
(From z In dtFinal.AsEnumerable Where z(“Sociedad”).ToString.Trim.Equals(“Ind Colombiana Cafe S.A.S”) Select (z(“LINEA NUEVA”))).orderby descending.Distinct.ToList
(From z In dtFinal
Where z("Sociedad").ToString.Trim.Equals("Ind Colombiana Cafe S.A.S")
Order By z("Ventas Netas Act") Descending
Select (z("LINEA NUEVA"))).Distinct.ToList()
(From z In dtFinal
Where z("Sociedad").ToString.Trim.Equals("Ind Colombiana Cafe S.A.S")
Order By CDbl(z("Ventas Netas Act").ToString) Descending
Select (z("LINEA NUEVA"))).Distinct.ToList()
Excellent, it no longer throws an error, but I do not understand why he is not organizing it in a descending way, I ask you, he will be doing the sum of all the values in “Venta Neta ACT” of each “Nueva Linea”
This is the table I have
Sociedad
LINEA NUEVA
Ventas Netas Act
Ind Colombiana Cafe S.A.S
Café Molido
3.574.326.788
Ind Colombiana Cafe S.A.S
Expresso
6.749.913.425
Ind Colombiana Cafe S.A.S
Via
5.897.977.821
Ind Colombiana Cafe S.A.S
Granulado
30.996.504
Ind Colombiana Cafe S.A.S
Expresso
769.013.840
Ind Colombiana Cafe S.A.S
Café Molido
1.791.115.710
Ind Colombiana Cafe S.A.S
Café Molido
2.840.688.102
Ind Colombiana Cafe S.A.S
Café Molido
45.908.105
Ind Colombiana Cafe S.A.S
Café Molido
6.218.319.019
Ind Colombiana Cafe S.A.S
Café Molido
2.721.157.339
Ind Colombiana Cafe S.A.S
Café Molido
5.144.180.207
Ind Colombiana Cafe S.A.S
Art Café
25.964.740
Cameron’s Coffee
Art Café
377.627.287
Cameron’s Coffee
Café Molido
1.394.387.184
Cameron’s Coffee
Café Molido
2.241.497.043
It would be to obtain the lines that belong to Ind Colombiana Cafe S.A.S and organize them in descending order with respect to the sum of their Ventas Netas Act
What does the last column contain? Can you explain how to interpret the numbers in the last column? Which number is larger and which is smaller? Manually, how the addition is done on such type of numbers?
Of course, the information in the last column contains the value of the sale that made the line, so in the linq, the idea is to obtain the list of lines in the order of which sold more to the one that sold less, But since there are lines that make more than one sale, the sales of each line must be added to know which one sold the most