<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Deepikak on Medium]]></title>
        <description><![CDATA[Stories by Deepikak on Medium]]></description>
        <link>https://medium.com/@deepika87k?source=rss-54107b3bc82d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*fRvnEgJaSR6Uf6Pg</url>
            <title>Stories by Deepikak on Medium</title>
            <link>https://medium.com/@deepika87k?source=rss-54107b3bc82d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:41:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@deepika87k/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Unified Palette of Scatter and Pie]]></title>
            <link>https://medium.com/@deepika87k/a-unified-palette-of-scatter-and-pie-13baf15fc3c0?source=rss-54107b3bc82d------2</link>
            <guid isPermaLink="false">https://medium.com/p/13baf15fc3c0</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[pie-charts]]></category>
            <category><![CDATA[scatter-plots]]></category>
            <category><![CDATA[tableau]]></category>
            <dc:creator><![CDATA[Deepikak]]></dc:creator>
            <pubDate>Fri, 16 Feb 2024 07:00:49 GMT</pubDate>
            <atom:updated>2024-02-16T21:05:56.800Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*JLDD4Jul-8oRriP7Ywr0Dg.png" /><figcaption>Scatterplot pie</figcaption></figure><p>In one of our projects in <strong>Tableau</strong>, we had the opportunity to create new and innovative charts, so we made a chart that combines scatterplot and pie chart <strong><em>Scatterplot pie chart</em></strong>, the name is confusing yet interesting.</p><p>To comprehend this chart, it’s important to understand what a scatter plot and pie chart are. <br> Scatter plots illustrate two different measures and establish a relationship between them. The chart depicts the direction of the data. Usually, the chart resembles a mathematical graph with dots or circles around it. Pie charts are a common tool for presenting data as a fraction with a whole in a circular chart that splits into pieces like a pie. They provide a comprehensive understanding of the data, especially when dealing with both quantitative and categorical dimensions for certain datasets</p><p>By combining two charts, you can generate beautiful scatterplot pie charts that are scattered throughout the view<strong>. LOD</strong> expressions are used to create these scatterplot pie charts in Tableau. You might be wondering what the LOD expressions are.</p><p>LOD stands for level of detail which calculates values involving many dimensions at the data source level instead of bringing everything onto the view. There are three types of LOD expressions.</p><p>· <strong>Fixed:</strong> Values with specific dimensions are calculated using this level of detail expression, regardless of what’s displayed in the view.</p><p><em>{FIXED [DIMENSION]: [AGGREGRATE EXPRESSION]}</em></p><p>· <strong>Include</strong>: The expression calculates values by utilizing the specific dimension and other dimensions available in the view. The syntax is:</p><p><em>{INCLUDE [DIMENSION]: [AGGREGRATE EXPRESSION]}</em></p><p>· <strong>Exclude</strong>: This level of detail expression calculates values without the specific dimensions in the view. The syntax is:</p><p><em>{EXCLUDE [DIMENSION]: [AGGREGRATE EXPRESSION]}</em></p><p>I believe our focus has shifted away from the scatterplot pie chart, but we are utilizing the LOD expression ‘FIXED’ to produce these charts. We are representing region-wise discount and quantity of products with segments as marks in the pie.<br> Look at the steps needed to create a scatterplot pie chart with the sample superstore data source.</p><p>1. Initially, add the sample superstore to the Tableau workbook.</p><p>2. Next create a calculated field named ‘<strong>region-wise discount’</strong> with FIXED LOD expression.<br> <br> <strong><em>{FIXED [REGION]: SUM[DISCOUNT]}</em></strong></p><p>3. Then again create a calculated field named ‘<strong>region-wise Quantity’</strong> <br> <br> <strong><em>{FIXED [REGION]: SUM[QUANTITY]}</em></strong></p><p>4. Drag’ region-wise discount’ onto the row shelf and ‘region-wise quantity’ onto the column shelf from the data pane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iFOMTJv87uMYrSTKQYvlBg.png" /></figure><p>5. Now drag the ‘<strong>Product name’</strong> into detail and change the shape into the pie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OyJS0T353jsHmdCA60lWkg.png" /></figure><p>6. Next drag ‘<strong>segment’</strong> onto color and ‘<strong>discount’ i</strong>nto size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*cb3-DMUBS1YBCnFE6wQW8w.png" /></figure><p>Voila !!! Scatterplot pie charts are created. As can be seen from the visualization above, pie charts are scattered across the view, with segments based on the discount of the products within the region. These charts might have visual appeal, attracting attention due to their unique and innovative nature.</p><p>There is a saying “Something that’s good but also has a downside”. This holds for scatterplot pie charts as the dots or pies are too small to see the marks in the pie chart. The visualization might fail to provide insights if the dataset is not well suited to these charts.</p><p><strong>Conclusion:</strong></p><p>To conclude, utilizing scatterplot pie charts in data visualization provides a well-rounded approach to conveying information. These charts are very effective in showcasing the relationship between two variables as well as presenting the distribution of categorical data. These charts may seem innovative, but it’s crucial to carefully consider the nature of the data and the goals of the visualization. These visualizations contribute to a comprehensive and insightful representation of data, catering to different analytical needs and enhancing the overall interpretability of complex datasets.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13baf15fc3c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crosstab() in PostgreSQL]]></title>
            <link>https://medium.com/@deepika87k/crosstab-in-postgresql-a5bf563f5d22?source=rss-54107b3bc82d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5bf563f5d22</guid>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[crosstab]]></category>
            <dc:creator><![CDATA[Deepikak]]></dc:creator>
            <pubDate>Mon, 12 Feb 2024 21:40:18 GMT</pubDate>
            <atom:updated>2024-02-13T01:20:32.581Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*RQPwhP1xpRSdtAPlc6RA_w.jpeg" /><figcaption>Crosstab</figcaption></figure><p>Recently I came across a unique function called <em>Crosstab()</em> in PostgreSQL. It is similar to the Pivot table in Excel but has a slightly different function. It also generates a pivot table in the PostgreSQL database and creates a new table with more organized data. In other words, Crosstab() is used for transposing a table.</p><p>However, it’s essential to approach using the crosstab() function with caution, especially with large datasets, as improper handling may lead to performance issues. The Crosstab() function rotates the results of the table or query that is present in columns to be displayed and the data that is present in the rows of the table to be represented in the vertical format. The Crosstab() function is supported by Postgres SQL version 9 and above.</p><p>The crosstab() has the <strong>SELECT</strong> statement as a parameter, and the statement output must have three columns.</p><ul><li>The first column identifies each row of the result table.</li><li>The second column represents the category.</li><li>The third column represents the value to be assigned to eac<em>h cell.</em></li></ul><p><strong>SELECT &amp; CROSSTAB()</strong><br>We can get a reasonable doubt of whether <em>“is there a difference between SELECT and CROSSTAB”?</em><br> <br>Let’s clarify the doubt by saying both serve similar purposes in retrieving and summarizing data from a database. While the SELECT statement provides a direct output, the CROSSTAB function enhances the presentation by organizing data in a table or grid format. The choice between SELECT and CROSSTAB depends on the user’s preference for the presentation of the result.</p><p><strong>Steps to create crosstab()</strong></p><p>There are many ways to utilize the crosstab function in Postgresql, but here is one of the ways, the function is used with an example.</p><p><strong>Step 1:</strong></p><p>First, create a sample table<em> custom_table</em> after creating the sample database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ihcHDTzTMy5BKcK4Afs6dw.png" /></figure><p><strong>Step 2:</strong></p><p>Then display the table by writing the query</p><p><em>select * from custom_table</em></p><p>Here is the raw data:</p><figure><img alt="Original data" src="https://cdn-images-1.medium.com/max/941/1*qrUTTM-g47FoCxvVqU9dXA.png" /><figcaption>Original Data table</figcaption></figure><p>The above table has 2 students ‘John’ and ‘Jill’ whose grades are posted in three subjects math, science, and History. so we are creating a new table implementing crosstab() which displays the subject in columns and grade in rows.</p><p><strong>Step 3:</strong></p><p>Here is how the crosstab function is enabled by writing the query</p><p><em>select *</em></p><p><em>from crosstab(‘select distinct(student),subject,grade</em></p><p><em>from custom_table</em></p><p><em>order by student’)</em></p><p><em>as ct(“student” varchar ,”math” char ,”science” char , “History” char)</em></p><p>The above query has the following :</p><ul><li>Select columns output: The query uses a select statement that retrieves three columns, [student],[subject], and [grade], from the [custom_table] table. The query is enclosed in the single quotes. You will get an error if the query is not specified in the single quotes.</li><li>The crosstab function is invoked for the select statement using the FROM clause –Select * from crosstab()</li><li>We are defining the columns for the pivot table and their data types.</li></ul><p><strong>Step 4:</strong></p><p><em>B</em>efore executing the query,<em> </em>we need to enable crosstab() by using the<em> tablefunc </em>module</p><p><strong><em>create extension tablefunc</em></strong><em> </em><br><em> <br> </em><strong>Step 5:</strong></p><p>After running the query in the query editor, the following output is displayed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*3v34yWxqOUv7ro0m3n99EQ.png" /><figcaption>Table after crosstab()</figcaption></figure><p><strong>The table above displays the grades of each student, with ‘grade’ listed in rows and ‘subject’ listed in columns.</strong></p><p><strong>Advantages of Crosstab():</strong></p><p>· It groups variables for a better understanding of the analysis.</p><p>· It allows you to closely investigate the data and examine the relationship between one or more variables.</p><p>· When the data is recorded, it is easy to mark any trends or patterns</p><p><strong>Disadvantages of Crosstab():</strong></p><p>· It is not compatible with the large dataset to interpret the results.</p><p>· The main limitation of crosstab() is it inserts each value into the first available column.</p><p>· Using crosstab(), the displayed output has mostly null values which look unpleasant in the table.</p><p><strong>Conclusion:</strong></p><p>In summary, the crosstab() function is a very powerful tool for consolidating and analyzing large amounts of data We have shown only one way of using the crosstab function, but there are multiple uses of this function in many other statements. To utilize this function we should have a deep understanding of SQL and the underlying data as it can be more complex with a large dataset. The crosstab() function’s ability to transform raw data into meaningful tables enables users to unravel complex relationships within their datasets.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5bf563f5d22" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>