title: Divided fix value based on pre-defined share to countries but euqally to channels
body: <p><strong><a href="https://dbfiddle.uk/?rdbms=postgres_13&amp;fiddle=99b053e1082bff3a7ab7ef0f01c35215" rel="nofollow noreferrer">DB-Fiddle</a></strong></p>
  <pre><code>CREATE TABLE costs (
      id SERIAL PRIMARY KEY,
      event_date DATE,
      country VARCHAR,
      channel VARCHAR,
      costs DECIMAL
  );
  
  INSERT INTO costs
  (event_date, country, channel, costs)
  VALUES 
  ('2020-02-08', 'DE', 'channel_01', '400'),
  ('2020-02-08', 'DE', 'channel_02', '400'),
  ('2020-02-08', 'FR', 'channel_01', '400'),
  ('2020-02-08', 'FR', 'channel_02', '400'),
  ('2020-02-08', 'NL', 'channel_01', '400'),
  ('2020-02-08', 'NL', 'channel_02', '400'),
  
  ('2020-04-15', 'DE', 'channel_01', '300'),
  ('2020-04-15', 'DE', 'channel_02', '300'),
  ('2020-04-15', 'FR', 'channel_01', '300'),
  ('2020-04-15', 'FR', 'channel_02', '300'),
  ('2020-04-15', 'NL', 'channel_01', '300'),
  ('2020-04-15', 'NL', 'channel_02', '300');
  </code></pre>
  <p><strong>Expected Result:</strong></p>
  <pre><code>event_date    |    country   |     channel       |            costs              |
  --------------|--------------|-------------------|-------------------------------|---------
  2020-02-08    |      DE      |     channel_01    |      120  (=400 x 0.6 / 2)    | 
  2020-02-08    |      DE      |     channel_02    |      120  (=400 x 0.6 / 2)    |   
  2020-02-08    |      FR      |     channel_01    |       60  (=400 x 0.3 / 2)    |   
  2020-02-08    |      FR      |     channel_02    |       60  (=400 x 0.3 / 2)    |   
  2020-02-08    |      NL      |     channel_01    |       20  (=400 x 0.1 / 2)    |   
  2020-02-08    |      NL      |     channel_02    |       20  (=400 x 0.1 / 2)    |  
  --------------|--------------|-------------------|-------------------------------|---------
  2020-04-15    |      DE      |     channel_01    |       90  (=300 x 0.6 / 2)    |   
  2020-04-15    |      DE      |     channel_02    |       90  (=300 x 0.6 / 2)    |   
  2020-04-15    |      FR      |     channel_01    |       45  (=300 x 0.3 / 2)    |   
  2020-04-15    |      FR      |     channel_02    |       45  (=300 x 0.3 / 2)    |   
  2020-04-15    |      NL      |     channel_01    |       15  (=300 x 0.1 / 2)    |   
  2020-04-15    |      NL      |     channel_02    |       15  (=300 x 0.1 / 2)    |   
  </code></pre>
  <hr />
  <p>With the below query from <a href="https://stackoverflow.com/questions/67401848/split-fix-value-to-countries-based-on-pre-defined-share-per-country">this question</a> I am able to divide the costs based on pre-defined shares <code>(DE=0.6, FR=0.3, NL=0.1)</code> to each country per day. <br></p>
  <pre><code>SELECT
  c.event_date,
  c.country,
  c.channel,
  (CASE WHEN c.country IN('DE') THEN c.costs * 0.6 
        WHEN c.country IN('FR') THEN c.costs * 0.3
        WHEN c.country IN('NL') THEN c.costs * 0.1 END) AS costs
  FROM costs c
  GROUP BY 1,2,3,4
  ORDER BY 1,2,3;
  </code></pre>
  <p>However, as you can see in the expected result I also want to divide the <strong>cost per country</strong> <strong>equally</strong> to each channel. <br></p>
  <p>How do I need to modify the query to achieve this?</p>