Skip to content

[Question] How to get the amount of x field per date from a table #291

Answered by Gusis93
Gusis93 asked this question in Q&A
Discussion options

You must be logged in to vote

To answer my own question, I read some other discussions and found this

dt
    .groupby('date')
    .pivot('tracker', { value: () => op.sum('1') })

which gives me the exact result I'm looking for, even with better results because it gets the other categories which aren't there and sets a 0.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Gusis93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant