title: How to build grouped top down forecast?
body: <p><em>Edited Version to provide a better understanding of the problem:</em></p>
  <p>Summary of the case:</p>
  <p>I have a dataset which has several levels (line, main group, subgroup and products) which are allocated to different countries.</p>
  <p>I want to build an aggregated forecast based on the top down approach to find the best aggregation level for my forecast.</p>
  <p>Therefore, I build a tsibble which I want to aggregate. Using the <code>aggregate_key()</code> can only build one parent/child relation (e.g. main group/product), but I have to consider all relationships to find the best aggregation level.</p>
  <p>So my first question: Can I implement a loop which runs through all possible levels or do I have to run all levels individually ?</p>
  <p>Second, I need to forecast in every country for it's own. While I can simply build a grouped structure within the bottom up approach (<code>aggregate_key(subgroup/product)*country</code>) , this does not work out for the top down (as I show in my reprex below).</p>
  <p>So my second question: Is it possible to do the grouping or do I have to forecast each country individually?</p>
  <pre><code>dat &lt;- data.frame(id=1:n, 
                    date=seq.Date(as.Date(&quot;2020-1-1&quot;), as.Date(&quot;2020-1-20&quot;), &quot;day&quot;),
                    country = rep(LETTERS[1:2], n/2),
                    line=sample(1:4,n, replace=TRUE),
                    main_group=sample(1:5, n, replace=TRUE),
                    subgroup=sample(1:10,n, replace=TRUE),
                    product=sample(1:20),
                    sales=sample(281:300)) 
  
  
  dat_tsibble = dat %&gt;%as_tsibble(key = c(product, country),
                                              index = date)
  
  dat_aggregated = dat_tsibble %&gt;% 
          aggregate_key((subgroup/product)*country,
                        sales= sum(sales))
  
  
  fit &lt;- dat_aggregated %&gt;%
          model(base = ETS(sales)) %&gt;%
          reconcile(
                  td = top_down(base)
          )
  
  
  fc = fit %&gt;% forecast(h=&quot;30 day&quot;)
  </code></pre>
  <p>I know that this df is not able to produce any forecast, but the error message is the same:</p>
  <p><a href="https://i.stack.imgur.com/Z5Pve.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>Thanks for any help!</p>