<?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 Abhinav KR on Medium]]></title>
        <description><![CDATA[Stories by Abhinav KR on Medium]]></description>
        <link>https://medium.com/@kishorerabhinav?source=rss-11f79a02ec6b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*iLViFafntbOhalwE</url>
            <title>Stories by Abhinav KR on Medium</title>
            <link>https://medium.com/@kishorerabhinav?source=rss-11f79a02ec6b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 09:40:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kishorerabhinav/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[RegEx to parse string data]]></title>
            <link>https://medium.com/@kishorerabhinav/regex-to-parse-string-data-b38cff7a7aaa?source=rss-11f79a02ec6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b38cff7a7aaa</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[regex]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[alteryx]]></category>
            <dc:creator><![CDATA[Abhinav KR]]></dc:creator>
            <pubDate>Sat, 04 Jun 2022 18:52:18 GMT</pubDate>
            <atom:updated>2022-06-06T19:24:30.424Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0xj2jLtVEkHI8RwKnp_q-g.png" /></figure><p>Often we come across files that are ill-formatted and where several columns of data might be merged into one. Below is an example of such a scenario:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*1s1Gs6IRC2OyQGnIeaAYUg.png" /><figcaption>chunks of text data merged together</figcaption></figure><p>And you can’t just feed such badly formatted text data into the dashboards. Now, at this time, you wish to parse your data using the delimiter but sometimes we come across data, that doesn’t have a delimiter at all.</p><p>Assume a case where the number of records is less (say under 10–20), you might be cleaning it manually but for tables having huge data, it is not going to be feasible at all.</p><p>This is where I came across RegEx or the Regular Expressions and I was amazed to see how it helps the data professionals to ease a lot of their text processing capabilities.</p><p>Let’s understand Text processing first,</p><p>Text processing is the automated process of analyzing and arranging unstructured text data to gain valuable insights. With applications in wide-ranging areas across a multitude of industries, it helps to scrape out valuable chunks of information from the noise.</p><p>RegEx or Regular Expressions (being one of the most powerful ways of manipulating string data), is a string of text that allows the end-users to create patterns that help match, locate, and manage text. It is widely used across different programming languages &amp; tools to add, remove, isolate, and manipulate all kinds of text and data.</p><p>You can check out sites like <a href="https://regex101.com/">regex101</a>, <a href="https://regexr.com/">regexr</a> &amp; <a href="https://regexone.com/">regexone</a> to understand and have a firm grip on the fundamentals of RegEx.</p><p><em>As someone working closely with Data (Data Engineer, Data Analyst, Business Analyst, Content Analyst, etc.), having familiarity with RegEx can ease up a lot of text processing use-cases. RegEx also helps to explore more advanced text analytics use cases, such as Natural Language Processing (NLP), Sentiment Analysis, and many more.</em></p><p>This week I had a similar use case of an ETL workflow where a particular column of data was having few words concatenated together without any delimiter in-between.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*21SxNR1eQ0N5OG5UnfmFZg.png" /><figcaption>column having concatenated data</figcaption></figure><p>Before diving into leveraging Alteryx to manipulate this data, let’s first understand a few basic RegEx expressions in order to proceed further:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*oU5Xj1KWKnwHQRND5m148Q.png" /><figcaption>some of the basic syntax of RegEx</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*uI3lrJpm3VdzDW4S9hCw1w.png" /><figcaption>Escape characters (⚠ case sensitive)</figcaption></figure><p>Let’s get back to Alteryx to see how we can utilize the above expressions in order to clean our concatenated column.</p><p><em>I love Alteryx for its USP of no-code yet power-packed self-service data analytics software suite. As someone coming from a no-coding background, I found it to be quite intuitive &amp; easy with its visual-based drag &amp; drop ETL framework.</em></p><p>Alteryx offers a RegEX tool to extend our text mining capability by utilizing Regular Expressions. Apart from the RegEx tool, the formula tool in Alteryx under the preparation category also supports RegEx syntax.</p><p>We will start with loading the data in Alteryx. <a href="https://docs.google.com/spreadsheets/d/12xnM5EbHAH7MND1e5AnYrNutvNC3OSr3/edit?usp=sharing&amp;ouid=100446059625221925935&amp;rtpof=true&amp;sd=true">Click here</a> to download the data if you want to follow along:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*voqRhYc2kOlKDEl-LA0l1g.png" /><figcaption>Data fed as input</figcaption></figure><p>This is the output that we are looking for:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*QSChpS6e9XTG_rvlZ9a7Ng.png" /><figcaption>Required output</figcaption></figure><p>We will be using a combination of the RegEx tool and formula tool to get our desired output.</p><p>Drag a RegEx tool from the Parse Category and connect it with the input data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*4a8h0iuQWwTv9udSPLawKw.png" /></figure><p>Apply the following RegEx expression in the configuration window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*ZGxIUosTYHE74CAWgzBgow.png" /></figure><p>This will provide us the Customer ID column along with the rest of the data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*_fM1xpBxL40l8hPsFQJ7bg.png" /></figure><p>Still, we need to extract the rest of the fields out of the concatenated field. Using another RegEx tool with the following configuration will give us the concatenated field without the Customer ID:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*_woPrvA2WAorY7HaRByV1A.png" /></figure><p>Next we will be using a formula tool from the preparation category and will be creating two new columns out of it in order to add space as the delimiter and then trimming down the additional whitespaces occurred during splitting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*FNdJRoRkW26DxNi7s7lWvQ.png" /><figcaption>Splitting the merged text into separate words</figcaption></figure><p>Here is the configuration for the formula tool, we will be using RegEx expressions here as well in order to separate the words.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*yru2JLav3Fbf_9qsUAluig.png" /></figure><p>This gives us two new columns. We will be proceeding with the second one or the trimmed one to further create new columns for each word and to match the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*eUvXEJttQvjD5LJZU1Vkvw.png" /></figure><p>Using a text to column tool with the following configuration, we separate the words into several new columns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*fLosYIObF-rrW_Y2wq3M_A.png" /></figure><p>This will give us the following output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*Zd7Bdq8Wjv1CSkzwrSZERw.png" /></figure><p>After this, we will use a Join tool and join on Record Id to get the original concatenated field and then use a Select tool to bring out the required fields only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*JCOyFkYi0BCuIxlm7tAy9Q.png" /></figure><p>We will use a Text to Column tool from the parse category with the following configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*GRQO7wiqYPI54Tfi6gsuKg.png" /></figure><p>It will give us the following output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*HbxK6aUVLSZDyaXr6GNWZQ.png" /></figure><p>From here, we will concatanate the required fields and then use the select tool to further rename and arrange the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*7qZs0UDDeSi2lPnrEi71sA.png" /></figure><p>At this stage, we are done with all the steps required, and here is our desired output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*hFZeJMWhaft7256WXjrUTA.png" /></figure><p>This is just an example of how we can use RegEx to manipulate and further process text data if it follows a repeatable pattern.</p><p><a href="https://drive.google.com/file/d/1mU9LCEy3k0ZXUwN44256sn3VoiG-CEC1/view">Here</a> is the complete workflow if you want to explore the configuration.</p><h4>Wrap Up:</h4><p>RegEx can be used in different ways, and also there are likely to be several approaches as well or maybe even better for this problem!</p><p>With this example, we explored how we can use RegEx to manipulate our text processing capability in a more powerful way.</p><p>One thing quite noteworthy here is not all tasks need the same level of preprocessing. There are cases where you can get away with the minimum. However, for others, the data may be ill-formatted or noisy that, if you don’t preprocess enough, it will be a garbage-in-garbage-out.</p><p>If you have any concerns/doubts on this one, please feel free to contact me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b38cff7a7aaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cross-Database Union in Tableau]]></title>
            <link>https://medium.com/@kishorerabhinav/cross-database-union-in-tableau-e6aab3807faf?source=rss-11f79a02ec6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6aab3807faf</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[business-intelligence]]></category>
            <category><![CDATA[tableau]]></category>
            <dc:creator><![CDATA[Abhinav KR]]></dc:creator>
            <pubDate>Tue, 17 May 2022 19:14:02 GMT</pubDate>
            <atom:updated>2022-05-18T03:09:10.101Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I was approached by my manager with a use case where he wanted to append a few records to a table. Further, he explained that the missing records were coming from another database, and most importantly, the missing records were having the same structure as the original ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*wW7H3JEfO9kZC3iP-k48RA.png" /><figcaption>Data in different database</figcaption></figure><p>He wanted both of them to be included in the table such that it provides a complete picture (&amp; the required details to be precise).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/252/1*WG5PuRHBVb8JU4T1vQpmKA.png" /><figcaption>Required Output</figcaption></figure><p><em>At first thought, it seemed to be a pretty straightforward scenario and I thought, yeah this seems pretty easy. And yes we can just do the union of the two and it will give us the required solution.</em></p><p><em>Now, this is when I came to realize that unfortunately, Tableau doesn’t support the cross-database union</em>.</p><p>But I had to find a way to do it because I firmly believe in the fact that Tableau is a very powerful &amp; robust BI tool and there are always multiple ways to accomplish our regular tasks with Tableau.</p><p>Now, many of you may point out that this can be accomplished by Tableau prep, but we didn’t have the access to that and also my goal was to do this using Tableau Desktop only.</p><p><em>Thanks to the wonderful Tableau community, there are a plethora of resources available to find the solutions for such cases. And with a little bit of web surfing, I was able to find a few solutions for that. In my opinion, the one shared by </em><a href="https://evolytics.com/blog/hacking-cross-database-unions-in-tableau-use-case-summary-and-tutorial/"><em>Evolytics</em></a><em> is quite easier to understand &amp; implement, we’ll continue with the same approach.</em></p><p>As we all know that Tableau does supports cross-database joins. So, we started by creating a dummy column in excel and then copy-pasting that in the Tableau Desktop as a separate data source:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/76/1*7mwBQtmvvF1u-VDaewapJA.png" /><figcaption>Dummy data</figcaption></figure><p>Next, we created a left join in Tableau Desktop and joined the dummy data &amp; the data from DB1 with a join calculation of 1 = 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*2ozL7H1Z_69FlrSF9wnaoA.png" /></figure><p>Similarly, we brought in the data from DB2 and joined it as well with a join calculation of 2 = 2. <em>(Note that, if the ask is to include data from multiple data sources, we can keep joining other ones in a similar way of join calculation of 3=3, 4 =4 and so on….)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*WLlMar5cA6oBnQZLq5V0jg.png" /></figure><p>Now that we have brought in our data from all the required databases, we can proceed with the required calculations in order to build the table. As of now, the data is still in its original format and we need to append them into one single table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*uRkvuVa2QkXUq4qZ14SmIg.png" /></figure><p>For this, we need to create a calculation using a CASE syntax which will use the ‘Source’ column from the Dummy data table, and using that we can create an appended version of each of the dimensions or measures and even dates as well.</p><p>Starting with the order ID, we can create an appended Order ID by creating a calculated field with the CASE statement:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*eGpfdhsNmWLcyXBkfoAYAg.png" /><figcaption>CASE [Source]<br>WHEN 1 THEN [Order ID]<br>WHEN 2 THEN [Order ID (Sheet1)]<br>END</figcaption></figure><p>And once we drag this calculation in the view, it will produce a list of all the order IDs from both the tables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*kYNxDvcQD-o-Wp-2VGuhfw.png" /></figure><p>Similarly, we can build the rest of the appended fields using the same case statement approach. In the article by <a href="https://evolytics.com/blog/hacking-cross-database-unions-in-tableau-use-case-summary-and-tutorial/">Evolytics</a>, they have used IFNULL &amp; ZN functions as an alternative to producing the same without using the CASE function.</p><p>For me, I was able to get the same result using the CASE statement only. Here is the final output being created by using all the newly created appended calculated fields for the respective dimensions &amp; measures:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*XRuo-k1Q8YK5JWBfO3X5rA.png" /><figcaption>Final Output created using appended fields</figcaption></figure><p>I hope, this will help with your use case as well. Also, please check out this amazing tutorial by <a href="https://www.youtube.com/channel/UCQRKZIhygTNRPTEmbWQ7LXg">Jellyman Education</a>, if you want to know how to do the same using Tableau Prep.</p><p>If you have any concerns/doubts on this one, please feel free to contact me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6aab3807faf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>