how to get unique value of datetime and sum all of the value ?
Show older comments
Hello Matlab Community
so i'm really new in Datetime class , so what i want is to sum all the value in the column 5 which is unit sold with it corrosponding dates but the dates are scatter and repeated so i want sum all of the unit with the same date , so how to do it?, here what i wrote and my brian just stop working i guess
date = FinancialSample{:,13};
U_sold = FinancialSample{:,5};
%plot(date,U_sold,'o')
[unqdate,idx,idx1] = unique(date);
for c = FinancialSample.Date == unqdate(:)
sum1(c)=sum(U_sold(c))
end
here the datetime array from microsoft https://docs.microsoft.com/en-us/power-bi/create-reports/sample-financial-download
edit: is there something not clear in my question plz ask me .
Accepted Answer
More Answers (0)
Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!