I'm trying to create a multidimensional array and afterwords using this same multidimensional array to create charts, but I don't know how to make this.
The logic I'd like to achive is below.
//T070_RESULT is an entity .Linq
public int id { get; set; }
public string entidade { get; set; }
public Nullable<int> entidadeID { get; set; }
public string unidadeMedida { get; set; } //not relevant for this question
public string valor { get; set; }
public Nullable<System.DateTime> date { get; set; }
//this list contains objects with the structure above
List<T070_RESULT> resultados = ListOfResults(idSample);
imagine this example (resultados list):
[id, entidade, entidadeID, unidadeMedida, valor, date]
[1, EntityX, 10, 10, 100, 01-09-16]
[2, EntityX, 10, 10, 80, 02-09-16]
[3, EntityX, 10, 10, 120, 01-10-16]
[4, EntityZ, 10, 10, 100, 01-09-16]
[5, EntityZ, 10, 10, 110, 01-10-16]
now I'd like to create a multidimensional array grouped by date and having this results below:
new object would be generated from the input above:
EntityX_Value(summed values for that month of that year) would be one column with all values grouped by date
EntityZ_Value the same
[id, EntityX_Value(summed values for that month of that year), EntityZ_Value, date]
[1, 180, 100, 01-09-16]
[2, 80, 110, 01-10-16]
(regarding dates, i don't need the day, i just need this grouped by month and year)
how can I do this, using linq or other methodology ?
09-16is not a representation of aDateTime. 3) what isEntityX_ValueandEntityZ_Value? (your input hasunidadeMedidaandvalor) 4) where does theidin the result come from?string[]?