<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SOMASES in Brasil</title>
    <link>https://community.qlik.com/t5/Brasil/SOMASES/m-p/2479110#M60992</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want to create a new field in your data based on a sum of cases, while grouping by Center Code and month, but without using single quotes for values. Assuming you're working with SQL or a similar query language, here's a general approach to achieve that:&lt;/P&gt;
&lt;P&gt;SQL Approach&lt;BR /&gt;If you're using SQL, you can achieve this with a GROUP BY clause and SUM function. Here's a basic example:&amp;nbsp;SELECT &lt;BR /&gt;CenterCode,&lt;BR /&gt;MONTH(DateColumn) AS Month,&lt;BR /&gt;SUM(Cases) AS TotalCases&lt;BR /&gt;FROM &lt;BR /&gt;YourTable&lt;BR /&gt;GROUP BY &lt;BR /&gt;CenterCode, &lt;BR /&gt;MONTH(DateColumn);&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Other Query Languages&lt;BR /&gt;For languages or tools like DAX in Power BI, or pandas in Python, the approach will vary slightly. Here’s how you might do it:&lt;/P&gt;
&lt;P&gt;DAX (Power BI)&amp;nbsp;NewField = &lt;BR /&gt;SUMX(&lt;BR /&gt;FILTER(&lt;BR /&gt;YourTable, &lt;BR /&gt;YourTable[CenterCode] = EARLIER(YourTable[CenterCode]) &amp;amp;&amp;amp;&lt;BR /&gt;MONTH(YourTable[DateColumn]) = EARLIER(MONTH(YourTable[DateColumn]))&lt;BR /&gt;), &lt;BR /&gt;YourTable[Cases]&lt;BR /&gt;)&amp;nbsp;Pandas (Python)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;import pandas as pd&lt;/P&gt;
&lt;P&gt;# Assuming df is your DataFrame&lt;BR /&gt;df['Month'] = df['DateColumn'].dt.month&lt;BR /&gt;result = df.groupby(['CenterCode', 'Month'])['Cases'].sum().reset_index()&lt;BR /&gt;result.rename(columns={'Cases': 'TotalCases'}, inplace=True)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.vanilla-giftcardbalance.com" target="_self"&gt;&lt;SPAN&gt;vanilla gift card balance&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2024 04:37:41 GMT</pubDate>
    <dc:creator>cris458carlo</dc:creator>
    <dc:date>2024-09-03T04:37:41Z</dc:date>
    <item>
      <title>SOMASES</title>
      <link>https://community.qlik.com/t5/Brasil/SOMASES/m-p/2475150#M60973</link>
      <description>&lt;P&gt;Olá,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Preciso criar um novo campo a partir de uma somases, que respeite o Cod Centro e o mês, mas sem especificar entre ' ' os valores.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de tela 2024-08-07 174349.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/170347iF893B730369187FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Captura de tela 2024-08-07 174349.png" alt="Captura de tela 2024-08-07 174349.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obrigado.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 21:01:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/SOMASES/m-p/2475150#M60973</guid>
      <dc:creator>julianoguerra</dc:creator>
      <dc:date>2024-08-07T21:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: SOMASES</title>
      <link>https://community.qlik.com/t5/Brasil/SOMASES/m-p/2475400#M60974</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/240353"&gt;@julianoguerra&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Experimente utilizar o qualificador &lt;STRONG&gt;total&lt;/STRONG&gt;, você pode estar definindo as dimensões a qual quer totalizar entre os sinais de menor e maior&amp;nbsp; &amp;lt;&amp;nbsp; &amp;gt;.&lt;/P&gt;
&lt;P&gt;Então seria algo assim:&lt;/P&gt;
&lt;P&gt;sum(&lt;STRONG&gt;total&amp;lt;[Mês/Ano],[Cod Centro]&amp;gt;&lt;/STRONG&gt;[Qtde Total])&lt;BR /&gt;&lt;BR /&gt;- Matheus&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 17:10:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/SOMASES/m-p/2475400#M60974</guid>
      <dc:creator>MatheusC</dc:creator>
      <dc:date>2024-08-08T17:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: SOMASES</title>
      <link>https://community.qlik.com/t5/Brasil/SOMASES/m-p/2479110#M60992</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want to create a new field in your data based on a sum of cases, while grouping by Center Code and month, but without using single quotes for values. Assuming you're working with SQL or a similar query language, here's a general approach to achieve that:&lt;/P&gt;
&lt;P&gt;SQL Approach&lt;BR /&gt;If you're using SQL, you can achieve this with a GROUP BY clause and SUM function. Here's a basic example:&amp;nbsp;SELECT &lt;BR /&gt;CenterCode,&lt;BR /&gt;MONTH(DateColumn) AS Month,&lt;BR /&gt;SUM(Cases) AS TotalCases&lt;BR /&gt;FROM &lt;BR /&gt;YourTable&lt;BR /&gt;GROUP BY &lt;BR /&gt;CenterCode, &lt;BR /&gt;MONTH(DateColumn);&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Other Query Languages&lt;BR /&gt;For languages or tools like DAX in Power BI, or pandas in Python, the approach will vary slightly. Here’s how you might do it:&lt;/P&gt;
&lt;P&gt;DAX (Power BI)&amp;nbsp;NewField = &lt;BR /&gt;SUMX(&lt;BR /&gt;FILTER(&lt;BR /&gt;YourTable, &lt;BR /&gt;YourTable[CenterCode] = EARLIER(YourTable[CenterCode]) &amp;amp;&amp;amp;&lt;BR /&gt;MONTH(YourTable[DateColumn]) = EARLIER(MONTH(YourTable[DateColumn]))&lt;BR /&gt;), &lt;BR /&gt;YourTable[Cases]&lt;BR /&gt;)&amp;nbsp;Pandas (Python)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;import pandas as pd&lt;/P&gt;
&lt;P&gt;# Assuming df is your DataFrame&lt;BR /&gt;df['Month'] = df['DateColumn'].dt.month&lt;BR /&gt;result = df.groupby(['CenterCode', 'Month'])['Cases'].sum().reset_index()&lt;BR /&gt;result.rename(columns={'Cases': 'TotalCases'}, inplace=True)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.vanilla-giftcardbalance.com" target="_self"&gt;&lt;SPAN&gt;vanilla gift card balance&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 04:37:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/SOMASES/m-p/2479110#M60992</guid>
      <dc:creator>cris458carlo</dc:creator>
      <dc:date>2024-09-03T04:37:41Z</dc:date>
    </item>
  </channel>
</rss>

