0
Questions about loop code...
let aa := this;
let mois := ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
let sommes := [];
for i from 1 to 12 do
let somme := sum((select inventory)[format(time, "MM") = i and format(time, "YY") = format(aa.deta, "YY")].Code);
sommes := array(sommes, sommes)
end;
let listItems := "";
for i from 0 to 12 do
listItems := listItems +
"
<li class='list-group-item d-flex justify-content-between align-items-start'>
<div class='ms-2 me-auto fw-bold'>" +
item(mois, i) +
"</div>
<span class='badge bg-primary rounded-pill'>" +
item(sommes, i) +
" </span>
</li>"
end;
html("<body>
" +
listItems +
"
</body>")
Hello everyone, I need to match the time with the total of the codes for the month. It should be the problem with the sixth line of code. Please help, thank you.
2 replies
-
Maybe a good time to use the fact that "for" loops can automagically build arrays:
let sommes := for i from 1 to 12 do
sum((select inventory)[format(time, "MM") = i and format(time, "YY") = format(aa.deta, "YY")].Code)
end;
Content aside
- Status Answered
- 3 mths agoLast active
- 2Replies
- 34Views
-
2
Following