Skip to content
Discussion options

You must be logged in to vote

Yay, I think I have fixed it. I used ChatGPT (sorry) and although its suggestions did not work as is, I have figured out in what direction to look and was able to fix it. The trick is to do aggregations in transform, give them names, and now I can use impute.

  {"calculate": "month(toDate(datum.date))", "as": "month"},
  {
    "aggregate": [{"op": "distinct", "field": "date", "as": "distinct_days"}],
    "groupby": ["month"]
  },
  {
    "impute": "distinct_days",
    "key": "month",
    "keyvals": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
    "value": 0
  }

Solution

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@khustochka
Comment options

Comment options

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