<?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 Nadia Sultana on Medium]]></title>
        <description><![CDATA[Stories by Nadia Sultana on Medium]]></description>
        <link>https://medium.com/@nadia-sultana?source=rss-131e6a9aed64------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*t6ayi9_6hu9NuOdsUuOfBw.jpeg</url>
            <title>Stories by Nadia Sultana on Medium</title>
            <link>https://medium.com/@nadia-sultana?source=rss-131e6a9aed64------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 19:45:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nadia-sultana/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[Migrating a Long-Running WordPress Site to Payload CMS (And All The Chaos That Came With It)]]></title>
            <link>https://blog.devops.dev/migrating-a-long-running-wordpress-site-to-payload-cms-and-all-the-chaos-that-came-with-it-7506c58fcc14?source=rss-131e6a9aed64------2</link>
            <guid isPermaLink="false">https://medium.com/p/7506c58fcc14</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[payload]]></category>
            <category><![CDATA[payload-cms]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[Nadia Sultana]]></dc:creator>
            <pubDate>Thu, 21 May 2026 13:30:32 GMT</pubDate>
            <atom:updated>2026-05-22T12:38:26.155Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LhSWbT3NmLgwFxHawKPo4Q.png" /><figcaption>Migrating WordPress Site to Payload CMS</figcaption></figure><p><strong>TL;DR for the skimmers:</strong></p><ul><li>Design the Payload schema before writing any migration code</li><li>Use a wpId field on every collection for idempotent upserts</li><li>Expect multiple media migration passes : the XML export won’t contain everything</li><li>The HTML-to-Lexical parser will dominate the timeline, budget accordingly</li><li>Separate migration scripts per content type is fine. Don’t build abstractions that are going to be deleted.</li></ul><p>If you’ve ever opened a WordPress XML export, scrolled for a while, and quietly wondered who let this happen, this post is for you.</p><p>Content migrations from WordPress to a headless CMS look simple on paper. Export. Transform. Load. Three words, absolutely not innocent in practice. Most of the work isn’t moving data, it’s figuring out what the data means and where and how it should live in the new system.</p><p>Recently i had to migrate a long-running Saas Documnetaion WordPress site to Payload CMS. A site that had been through a commercial page builder like Divi, SEO plugin, a custom FAQ plugin, and at least three different image upload mechanisms over the years.</p><p>This post is about what worked, what didn’t, and the specific patterns that did it correctly when the script ran for the 30th time at 1 AM and finally produced clean output.</p><h3>1. Design the Payload Schema Before Writing Any Migration Code</h3><p>The migration script is throwaway code. The Payload collection is what the editorial team lives inside for the next several years. Spending a week on schema decisions before writing a single line of migration code is what keeps the project from becoming a rewrite of WordPress with extra steps.</p><p>Three decisions in this project carried more weight than everything else combined:</p><p><strong>Model hierarchy with a self-referencing relationship, then derive the path from it.</strong> The documentation pages, policy pages, and integration catalog all had parent-child relationships. Some three or four levels deep. Each collection has a parent field pointing at the same collection, plus a read-only fullSlug and fullUrl that get recomputed in a beforeChange hook by walking up the parent chain:</p><p>This does two things. First, renaming a parent page doesn’t break any of its children and the next save rewrites the full path. Second, the unique constraint goes on fullSlug (like docs/integrations/[provider]/setup), not on the individual slug. Multiple pages called &quot;setup&quot; under different parents is fine, because each resolves to a unique full path. WordPress handles this with friendly URL aliases. Payload handles it with a derived path. Both work, but the model needs to be committed to before the migration starts.</p><p><strong>Stamp every migrated document with its WordPress ID.</strong> A wpId number field, hidden in the sidebar, read-only. Not for the editors but the migration script. This is what makes re-running the script safe instead of catastrophic. Section 2 covers the mechanics, but the schema decision needs to happen here: if the field doesn&#39;t exist on the collection, none of the idempotency logic works.</p><p><strong>Decide which WordPress structures become their own collections vs. blocks within a collection.</strong> The source site had landing pages, policy pages, documentation, an integration catalog, FAQs, and blog posts. These all lived in WordPress’s posts and pages tables, differentiated by parent IDs, custom post types, and template names. In Payload they became separate collections because each had fundamentally different fields: integration pages have a category relationship and platform-specific metadata. Documentation pages have a breadcrumbs array and cross-linking to related articles. Policy pages have none of that. FAQs are just a question/answer pair. If these had been shoe-horned into one pages collection with conditional fields, the admin panel would have been unusable.</p><h3>2. Use a wpId Field for Idempotent Migrations</h3><p>The migration script runs more than once. A lot more than once. Different subsets, different flags, different content types, recovery attempts after something breaks. In this project the documentation migration script alone ran dozens of times before everything settled.</p><p>Without a way to identify “is this WordPress post already in Payload?”, duplicates pile up on every run. Once is annoying. Thirty times is a cleanup project of its own.</p><p>The fix is a small in-memory map populated at the start of every run:</p><p>Then during import:</p><p>The script is now idempotent. Same input produces the same result. This unlocks everything else: staging refreshes, retry logic, partial reruns when a parsing bug surfaces halfway through a batch.</p><p>Seven collections in this project ended up with wpId fields. Every migration script uses the same map-and-upsert pattern. It&#39;s boring, and that&#39;s the point.</p><h3>3. Media Migration Won’t Be One Script</h3><p>This is where the clean narrative “write a media resolver” falls apart.</p><p>WordPress had a complicated relationship with its own media library. The same image could appear in body HTML as a full CDN URL, a WordPress-generated size variant ( screenshot-300x200.png), an artifact from a half-completed format migration ( screenshot.png.webp), a protocol-less reference, or a relative path with no domain.</p><p>And that’s just the images that were in the media library. This particular site also had:</p><ul><li><strong>60+ images uploaded directly to the server via FTP</strong> years ago, never registered in WordPress’s media library at all. They lived on disk but had no database entry. The XML export didn’t mention them.</li><li><strong>~100 theme images</strong> from the child theme’s CSS such as retina variants at 2x and 3x, icon sprites, background patterns. These were referenced in stylesheets, not in post content, but the new site needed them in Payload’s media collection so the storage adapter could serve them from S3.</li></ul><p>That’s three separate media migration scripts. The first handles the XML export. The second is a hardcoded list of FTP URLs discovered by crawling the staging server. The third is a hardcoded list of theme asset paths. None of them shared code with each other beyond the Payload create call.</p><p>The first script also had a subtle bug that took weeks to surface. Retina images like icon@2x.png and logo@3x.png were all failing silently. The WordPress XML stored their attachment URLs with %40 (URL-encoded @) in the filename: icon%402x.png. The migration script extracted the filename with path.basename(new URL(...).pathname) which doesn&#39;t decode URL encoding. Payload received icon%402x.png instead of icon@2x.png. Thirteen images affected. The fix was a one-liner ( decodeURIComponent), but finding it required inspecting the XML by hand and wondering why only images with @ in the name were broken. This is the kind of bug that only shows up when you stop looking at the script and start looking at the data.</p><p>In this project the content-body media resolver (used during HTML-to-Lexical conversion) was a lookup function, not a migration script.</p><p>A tiered lookup: exact match, then lowercase, then strip the WordPress size suffix, then substring fallback. Anything that still misses goes into a missingMediaSrcs set that prints at the end of the run, grouped by page slug.</p><p>An important decision: <strong>don’t fail the document write when a media reference can’t be resolved.</strong> Some source HTML will point at images that aren’t in the export at all. If the script throws on missing media, the whole migration stops on the first batch. Logging and continuing produces a clean triage list at the end instead of a hard halt at the start.</p><h3>4. The HTML-to-Lexical Body Parser Is Where Most of the Time Goes</h3><p>WordPress stores rich content as HTML. Payload wants a structured Lexical JSON tree. The documentation parser alone ended up at ~900 lines. Here’s why:</p><p><strong>Page builder wrappers everywhere.</strong> The source HTML wasn’t clean semantic markup. It was wrapped in multiple layers of page builder containers like section &gt; row &gt; column &gt; module &gt; text-inner &gt; actual content. Sometimes there were additional wrapper divs with custom CSS classes. The parser had to recognize and recurse through all of them without treating them as content.</p><p><strong>HTML entity decoding.</strong> Smart quotes, sequences, numeric entities, etc. What’s worth noting is that two separate implementations of decodeHtmlEntities() ended up in the codebase because policy pages and documentation were migrated as separate scripts with slightly different entity handling. Copy-paste creeps in when scripts are written independently.</p><p><strong>Page-builder shortcodes that need to become Payload blocks.</strong> A toggle module becomes a CollapsibleBlock. A styled button with a specific CSS class becomes a CustomLink block. A row of grouped tabbed links for different integration methods becomes a multi-link block. Each of these has different Lexical node shapes.</p><p><strong>Inline images that need to become </strong><strong>MediaBlock references.</strong> WordPress drops &lt;img&gt; tags anywhere: inside paragraphs, inside list items, inside blockquotes. Payload&#39;s Lexical editor represents images as block-level nodes with a relationship to a media document. The parser has to extract inline images, resolve them through the media lookup, and emit them as separate nodes.</p><p>The pattern that works: use JSDOM to walk the source HTML, classify each node, emit the corresponding Lexical structure. Be explicit and boring. Don’t try to be clever.</p><p>The central processor ended up looking like this:</p><p>The inlineBuffer pattern is worth calling out. WordPress HTML sometimes has bare text nodes between block elements. Lexical requires all text to live inside a paragraph node. The buffer collects loose text and flushes it into a paragraph whenever a real block element comes along.</p><p>The classification rules are specific to the source site. In this project, the documentation parser handled things the policy page parser didn’t (FAQ accordions, tabbed link blocks) and vice versa (tables, back-navigation links). Each script handles its own content type.</p><p>One thing the code above doesn’t convey: the parser wasn’t designed correctly on the first pass, or the second, or the third. The first dry-run produced 9 media blocks across 80 pages. That was clearly wrong. The source HTML had images everywhere. The fix for images inside &lt;p&gt; tags bumped it to 160. Then it turned out blocks nested inside &lt;li&gt; elements were being silently skipped. Then support buttons inside &lt;p&gt; tags weren&#39;t becoming CustomLink blocks. Then querySelector was only grabbing the first page builder text block on pages that had several. Each dry-run revealed a new class of missed content.</p><p>The parser wasn’t designed but discovered, one bug at a time.</p><p>For example, one bug from this phase didn’t surface until much later, which is the lesson in itself. The parser generated Lexical node IDs with Date.now() plus a short random hex suffix. On fast iterations, Date.now() returns the same millisecond twice, and the random suffix occasionally collided producing duplicate node IDs across a document. The migrated content rendered fine on the front-end, so nothing looked wrong. But opening those documents in the Payload admin editor crashed it with a React duplicate-key error. A parser bug, surfacing as a CMS crash. The fix was a proper unique ID generator; finding it meant tracing a React error in the admin panel all the way back to a migration script that had already been deleted.</p><p>Speaking of which.</p><h3>5. Accept That You’ll Have Separate Scripts Per Content Type</h3><p>This is something I chose not to gloss over, and it’s worth being honest about. The project didn’t end up with one unified migration system. I ended up with twelve separate scripts:</p><ul><li>migrate-media.ts: XML export media</li><li>migrate-media-ftp.ts: 60+ FTP images not in WordPress</li><li>migrate-theme-media.ts: ~100 theme images from the child theme</li><li>migrate-clients.ts</li><li>migrate-categories.ts</li><li>migrate-platforms.ts: taxonomy terms for the integration catalog</li><li>migrate-pages.ts: root landing pages (page builder hero detection)</li><li>migrate-policy-pages.ts: 5 policy pages with table support</li><li>migrate-docs.ts: ~65 hierarchical documentation pages (the big one)</li><li>migrate-integrations.ts: ~100 integration catalog pages</li><li>migrate-faqs.ts: FAQ custom post type from XML</li><li>migrate-bespoke.ts: one hand-crafted page that didn&#39;t fit the general parser</li></ul><p>Each has its own CLI flags (--dry-run, --limit, --slug, --verbose, --force-update), its own HTML-to-Lexical converter (ranging from &quot;strip all tags and split by newlines&quot; for landing pages to the full 900-line parser for documentation), and its own idempotency logic.</p><p>A planned unified CLI entry point ( scripts/index.ts) never got built. Running individual scripts worked fine and less time consuming as well.</p><p>The fragmentation wasn’t a failure of planning. It was a consequence of the “design the schema first” advice. Each content type had different fields, different block types, different HTML structures, and different parent/child relationships. The documentation needed hierarchy sorting and related-articles linking. The policy pages needed back-navigation stripping and table support. The integration catalog needed category taxonomy mapping. The FAQ custom post type had to be parsed from XML, not JSON.</p><p>Didn’t want to optimize for dry. Feels like a trap!</p><h3>6. Lexical Block Constraints Need a Sanitization Pass</h3><p>This one caught me off guard, and it cost a day of mysterious validation errors.</p><p>Lexical blocks have rules about what they can contain. A CollapsibleBlock might allow h2 through h6, paragraphs, lists, media, and horizontal rules but not h1, blockquotes, or nested collapsibles. Real source HTML doesn&#39;t always follow those rules.</p><p>The documentation parser hits this constantly because the WordPress FAQ plugin generates accordion sections, and those sections contain whatever HTML the editor put in them including other FAQ sections. Nest an accordion inside an accordion and Payload rejects the write.</p><p>The fix is a sanitization pass that runs between parsing and writing:</p><p>Without this, roughly a quarter of documents can fail validation at write time. The error messages don’t indicate which nested rule was violated, which is most of what makes this expensive to debug the first time.</p><h3>7. WordPress URL Aliases Need Their Own Mapping…sometimes</h3><p>This took a full afternoon to figure out and it’s not obvious.</p><p>WordPress has a concept of “friendly” URL aliases. A documentation page might live at /docs/integrations/provider-a/setup-guide-full but also be reachable at /docs/provider-a/setup. The short URL is what appears in navigation links and &quot;related articles&quot; sections within other pages.</p><p>Payload doesn’t have this concept. A document has one slug, one parent chain, one fullSlug. So when the source HTML contains a related-articles section with links like /docs/provider-a/setup, that path can&#39;t just be looked up in Payload. It doesn&#39;t exist.</p><p>The fix was a hardcoded lookup table mapping WordPress friendly URLs to the actual Payload fullSlug:</p><p>This table was built by manually inspecting which WordPress page each friendly URL pointed to. It’s not glamorous work. But without it, related-articles links would silently fail to resolve, and the migrated site would have broken cross-linking.</p><p>The SEO plugin’s breadcrumb schema data was useful here as it was a structured BreadcrumbList JSON with absolute URLs and titles, which helped verify that the mapping was correct.</p><h3>8. Build Dry-Run Mode From Day One</h3><p>The highest-leverage decision is adding proper CLI flags at the start of the project, not at the end:</p><pre>tsx migrate-docs.ts --dry-run tsx migrate-docs.ts --dry-run --limit =5 tsx migrate-docs.ts --slug =getting-started tsx migrate-docs.ts --force-update</pre><p>These take an hour to add per script. They save days of cleanup over the course of the project. Once they exist, make --dry-run the default. Running the script accidentally should be harmless.</p><p>The --slug flag is particularly valuable when debugging a single problematic page. Running the parser against one document and inspecting the full Lexical output without touching the database saves 20 minutes of debugging.</p><p>Running the migration in dry-run mode with verbose logging also turned out to be useful beyond catching script bugs. Inspecting every document on its way through the parser surfaced things worth flagging:</p><ul><li><strong>Slug collisions across different parents</strong>, usually legitimate. Three pages named “setup” under different parent integrations is fine when the unique constraint is on fullSlug.</li><li><strong>Orphaned drafts with no slug</strong>, reachable only by ?page_id=12345 URLs.</li><li><strong>Media references without matching files</strong> in the export.</li><li><strong>One page whose HTML was unique enough</strong> that it warranted its own bespoke migration script rather than trying to bend the general parser to handle it.</li></ul><p>The dry-run output ended up serving as the definitive content inventory.</p><h3>9. Sort by Hierarchy Before Migrating</h3><p>When content is hierarchical, parents need to be migrated before children.</p><p>The documentation pages formed a tree. The wpIdToPayloadId map needs the parent&#39;s Payload ID before setting the child&#39;s parent relationship field. Process children first and the lookup fails, leaving orphaned documents.</p><p>The fix was a topological sort that guarantees parents come before children:</p><p>The circular dependency guard is there because one page in the export referenced a parent that didn’t exist in the set. Without it, the sort loops forever.</p><h3>Closing Thoughts</h3><p>The chaos isn’t in the code. It’s in the decisions and the modeling. Which content types become their own collections? Which URL conventions carry over? What counts as a “block” versus a “field”? The migration script just translates those decisions one at a time.</p><p>PS — I didn’t write all of this code alone, either. Claude and GLM were on the team for most of it, especially through the parser layer where pattern-matching twelve variations of the same shortcode is exactly the tedious work AI is good at. The architectural calls stayed mine; the boilerplate didn’t. If a deeper post on that workflow would be useful consisting what I prompted, where it failed, where it shaved off days versus quietly added them back, say so in the comments and I’ll write it up.</p><p>Keep your dry-runs greedy and your logs verbose.</p><p><em>Originally published at </em><a href="https://dev.to/nadiasultana/migrating-a-long-running-wordpress-site-to-payload-cms-and-all-the-chaos-that-came-with-it-jf9"><em>https://dev.to</em></a><em> on May 21, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7506c58fcc14" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/migrating-a-long-running-wordpress-site-to-payload-cms-and-all-the-chaos-that-came-with-it-7506c58fcc14">Migrating a Long-Running WordPress Site to Payload CMS (And All The Chaos That Came With It)</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Things That Gave Me Headaches About React in the Past Year (And How I Survived)]]></title>
            <link>https://nadia-sultana.medium.com/things-that-gave-me-headaches-about-react-in-the-past-year-and-how-i-survived-9d2d9c4710ac?source=rss-131e6a9aed64------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d2d9c4710ac</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[developer-experience]]></category>
            <category><![CDATA[react-developer]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react-hook]]></category>
            <dc:creator><![CDATA[Nadia Sultana]]></dc:creator>
            <pubDate>Wed, 11 Jun 2025 13:24:41 GMT</pubDate>
            <atom:updated>2025-06-11T20:25:02.512Z</atom:updated>
            <content:encoded><![CDATA[<p>By: <em>A (Slightly Traumatized) React Developer</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JFsutN3qaPl7qeKp2R_eyw.png" /></figure><p>React is amazing — until it isn’t. Over the past year (or two), while building React applications, I’ve encountered my fair share of<em> frustrating</em> quirks that made me question my life choices. Some of these issues are rarely discussed in tutorials but pop up like monsoon rain when you’re knee-deep in a complex app.</p><p>So, grab some coffee (or something stronger) and go over the React pains that made me lose sleep.</p><h4>1. When useEffect Dependencies Decieve You</h4><p>Let’s start with everyone’s favorite hook that’s definitely not overused… useEffect.</p><p>You’ve a component that fetches user data, and you’re being a good developer by properly listing your dependencies. Everything looks perfect:</p><pre>useEffect(() =&gt; {<br>  fetchUserData(userId);<br>}, [userId, fetchUserData]);</pre><p>But wait! Your ESLint exhaustive-deps rule is screaming at you because fetchUserData is causing infinite re-renders. Why? Because that simple function is being recreated on every render, making it a &quot;new&quot; dependency each time.</p><p>So you use useCallback ? NO.</p><p>The solution isn’t always useCallback. Sometimes you need to ask yourself: &quot;Does this function <strong><em>really</em> </strong>need to be a dependency?&quot; Often, the answer is no—especially for stable functions from custom hooks or imported utilities.</p><h4>2. useCallback and useMemo: The False Optimizations</h4><p>We’ve all been there — throwing useCallback and useMemo everywhere because &quot;performance,&quot; only to realize we’ve made things worse.</p><pre>const memoizedCallback = useCallback(() =&gt; {<br>  doSomething(dep1, dep2);<br>}, [dep1, dep2]); // Seems legit, right?</pre><p>The Problem:</p><ul><li>useCallback doesn’t <em>prevent</em> function creation—it just returns a memoized version.</li><li>If dep1 or dep2 changes often, you’re still re-creating the function.</li><li>Overusing useMemo for cheap computations? That’d be adding more overhead than savings.</li></ul><p>When to Use Them:</p><ul><li>When passing callbacks to heavily memoized children (React.memo).</li><li>When computing expensive derived data (e.g., filtering large lists).</li></ul><p>Otherwise? <strong><em>Just inline the function.</em></strong></p><h4>3. The Context Performance Trap (AKA “Why Is Everything Re-rendering?”)</h4><p>Context is amazing… until it’s not. I learned it the hard way.<br>Here’s the scenario that’s burned me more times than I care to admit:</p><pre>const UserContext = createContext();<br>const UserProvider = ({ children }) =&gt; {<br>  const [user, setUser] = useState(null);<br>  const [preferences, setPreferences] = useState({});<br>  <br>  // This object is created on every render<br>  const value = {<br>    user,<br>    setUser,<br>    preferences,<br>    setPreferences,<br>    // Maybe 10 more properties...<br>  };<br>  <br>  return (<br>    &lt;UserContext.Provider value={value}&gt;<br>      {children}<br>    &lt;/UserContext.Provider&gt;<br>  );<br>};</pre><p>My mentor would congratulate me for creating a performance nightmare.</p><p>Every component consuming this context will re-render whenever <em>anything</em> in that value object changes, because the entire object is new on every render.</p><p><strong>What did I learn?<br></strong>Context is not a state management solution — it’s a way to inject dependencies. We need to stop treating it like Redux otherwise you get Redux problems with no Redux solutions.</p><p><strong>What Works</strong>:</p><ul><li>Split your contexts by concern</li><li>Memoize context values</li><li>Consider if you actually need context, because prop drilling for 2–3 levels is much easier and cleaner</li></ul><h4>4. The Uncontrolled-to-Controlled Input Warning That Haunts In Sleep</h4><blockquote>“A component is changing an uncontrolled input to be controlled.”</blockquote><p>You’ve probably come across this warning — I know I’ve seen it plenty of times.</p><p>Why It Happens:</p><ul><li>You passed undefined or null as a value prop, then later switched to a real value.</li><li>React thinks your input is uncontrolled (no value prop) but then becomes controlled (value is set ).</li></ul><p><strong>The Fix:</strong> Always initialize controlled inputs with a default (even an empty string)</p><pre>const [value, setValue] = useState(&#39;&#39;); // Not `useState()`</pre><p><strong>Bonus Pain:</strong> If you’re dealing with third-party form libraries, this warning might pop up in <em>their</em> code. I don’t know what prayer to say to debug this.</p><h4>5. key Prop Shenanigans in Lists</h4><p>I once spent an entire afternoon debugging why a list component was behaving erratically. Items would flicker, form inputs would lose focus, and animations would glitch. The culprit?</p><pre>{items.map((item, index) =&gt; (<br>  &lt;Component key={index} /&gt; // The &quot;I like bugs&quot; approach<br>))}</pre><p>I’m sure my mentor lost a few strands after seeing how much I used indexas key.</p><p>Why It’s Bad:</p><ul><li>Using index as key causes subtle bugs when the list order changes.</li><li>State gets mixed up, focus is lost, and React’s diffing goes haywire.</li></ul><p><strong>The Fix: </strong>Use a <em>unique, stable</em> ID. If your data doesn’t have one, generate it.</p><pre>{items.map(item =&gt; (<br>  &lt;Component key={item.id} /&gt; // Much better<br>))}</pre><p><strong>Tip</strong>: If your list is <em>static</em>, index is <em>fine</em>. But in dynamic lists? <em>NEVERRR.</em></p><h3>6. Infinite Loops in useEffect (And How to Blame Yourself)</h3><p>Every day, I wake up grateful to the seven heavens for having a senior who takes the time to explain the nitty gritty of React, such as this:</p><pre>useEffect(() =&gt; {<br>  setState(state + 1); // Congratulations, you played yourself.<br>}, [state]);</pre><p>This useEffect !!! It re-runs. And re-runs. And re-runs…</p><p><strong>The Problem:</strong> Updating state inside an effect that depends on that state = infinite loop.</p><p><strong>The Fix:</strong></p><ul><li>Ask: <em>“Do I really need this state as a dependency?”</em></li><li>Maybe use a ref or rethink the logic.</li></ul><h4>7. The Great TypeScript Generic Inference Failure</h4><p>When using TypeScript with React (and you should be), you’ve probably encountered this nonsensical situation:</p><pre>const [data, setData] = useState&lt;ComplexApiResponse | null&gt;(null);<br><br>useEffect(() =&gt; {<br>  api.fetchData().then(response =&gt; {<br>    // TypeScript: &quot;I have no idea what type response is&quot;<br>    setData(response); // Type error!<br>  });<br>}, []);</pre><p><strong>The Problem</strong>: TypeScript’s type inference with React hooks can be… optimistic. Generic constraints don’t always work the way you expect, and you end up with type assertions or overly complex generic parameters.</p><p><strong>The Fix</strong>: More like a compromise, sometimes you simply have to be more explicit with your types than feels necessary. The type safety is worth it, although the developer experience can be a little unpleasant.</p><h4>8. The Component That Does Everything ( And causes additional hassles)</h4><p>Here’s an issue that gets little attention: the duality of choice in component design.</p><p>React’s versatility is both its greatest asset and the source of numerous structural disputes.</p><p>The requirement is simple: <em>“Create a reusable Button component.”</em></p><p>Later, you have:</p><pre>&lt;Button<br>  variant=&quot;primary&quot;<br>  size=&quot;large&quot;<br>  loading={isLoading}<br>  disabled={isDisabled}<br>  leftIcon={&lt;IconUser /&gt;}<br>  rightIcon={&lt;IconChevron /&gt;}<br>  fullWidth<br>  onClick={handleClick}<br>  as=&quot;a&quot;<br>  href=&quot;/somewhere&quot;<br>  target=&quot;_blank&quot;<br>  className=&quot;custom-button&quot;<br>  data-testid=&quot;submit-button&quot;<br>  // ... 15 more props<br>/&gt;</pre><p><strong>Let’s analyze this:<br></strong>It starts with “just add one more prop for this edge case.” Before you know it, a “simple” button component has 30+ props, complex conditional logic, TypeScript definition, and whatnot.</p><p>Every new edge case leads to different debates:</p><ul><li>Should this be a prop or a separate component?</li><li>How many variants is too many? What about sizes?</li><li>When do we split this into multiple components?</li></ul><p><strong>Why does this happen?<br></strong>You want reusability and simplicity. You want to be flexible, but also consistent. You want to meet all use cases while still writing maintainable code. These goals can often be at odds with one another.</p><p>It’s better to avoid the “right” solution that nobody can maintain.</p><p><strong>What Works</strong>: Start components simple and evolve. We don’t need to predict every future use case. And, as my mentor points out, sometimes, having multiple similar smaller components is better than one mega-component that does everything.</p><p>To conclude, React is great, but it also bites and creates an absolute mess. The idea is to recognize and efficiently fix the issues, rather than avoiding them altogether.</p><p>P.S. — If you’ve made it this far and haven’t encountered at least three of these issues, either you’re incredibly fortunate, or you’re about to be introduced to some. Happy debugging!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d2d9c4710ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Magic of Mongoose Middlewares]]></title>
            <link>https://nadia-sultana.medium.com/magic-of-mongoose-middlewares-d45cb78e7c97?source=rss-131e6a9aed64------2</link>
            <guid isPermaLink="false">https://medium.com/p/d45cb78e7c97</guid>
            <category><![CDATA[mongodb-with-mongoose]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[mern-stack-developer]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Nadia Sultana]]></dc:creator>
            <pubDate>Thu, 01 Feb 2024 15:48:15 GMT</pubDate>
            <atom:updated>2024-02-01T15:49:26.340Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLzmuDzFOH_ZXrcpLc7GDg.png" /></figure><p>Mongoose Middlewares — the incredible tools that add sorcery to your database interactions by giving a layer of customization that goes beyond the ordinary. This piece offers a behind-the-scenes look at Mongoose’s secret spells, where every line of code has the power to influence the life cycle of your data. So, grab your wand (or keyboard), and let’s uncover the secrets together!</p><h3><strong>Understanding Mongoose Middlewares</strong></h3><p>Mongoose middlewares are methods that allow you to inject custom logic into a Mongoose document at various stages of its lifecycle. You can customize behavior for your application, such as saving, updating, deleting, or verifying data.</p><blockquote><strong><em>Pre-Save Middleware</em></strong></blockquote><p>Consider a scenario where you want to automatically generate a unique username for a new user before saving it to the database. Here’s how you can employ the pre-save middleware:</p><pre>userSchema.pre(&#39;save&#39;, function (next) {<br> if (!this.username) {<br> this.username = generateUniqueUsername(); // logic for generating a unique username<br> }<br> next();<br>});</pre><p>With this middleware, every time a new user document is saved, if the username is not provided, it dynamically generates one before saving it to the database.</p><blockquote><strong><em>Pre-Update Middleware</em></strong></blockquote><p>Let’s say you want to log the timestamp of the last update every time a user document is updated. The pre-update middleware comes to the rescue:</p><pre>userSchema.pre(&#39;updateOne&#39;, function (next) {<br> this.update({}, { $set: { lastUpdate: new Date() } });<br> next();<br>});</pre><p>This middleware triggers before the <strong>updateOne</strong> operation, allowing you to inject additional update operations — in this case, updating the lastUpdate field.</p><blockquote><strong>Post-Remove Middleware</strong></blockquote><p>When a document is removed from the database, you might want to perform additional cleanup actions.</p><p>Let’s say you have a user schema and a blogpost schema that has author_id reference to user. If a user deletes their account from your website you would want to delete all their blogs as well, right? Here’s how you can use post-remove middleware to do exactly that:</p><pre>userSchema.post(&#39;remove&#39;, async function (doc, next) {<br>  try {<br>    // Find and remove all blog posts associated with the deleted user<br>    await mongoose.model(&#39;BlogPost&#39;).deleteMany({ author_id: doc._id });<br><br>    console.log(`User ${doc.username} and associated blog posts have been deleted.`);<br>    next();<br>  } catch (error) {<br>    console.error(&#39;Error cleaning up associated blog posts:&#39;, error);<br>    next(error);<br>  }<br>});</pre><p>To sum up, Mongoose middlewares are the secret sauce that can take your MongoDB experience to new heights giving you unparalleled control and customization over your database. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d45cb78e7c97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Manipulation In SQL: A Concise Overview]]></title>
            <link>https://blog.devops.dev/data-manipulation-in-sql-a-concise-overview-4134ebbb433d?source=rss-131e6a9aed64------2</link>
            <guid isPermaLink="false">https://medium.com/p/4134ebbb433d</guid>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Nadia Sultana]]></dc:creator>
            <pubDate>Mon, 30 Jan 2023 11:23:15 GMT</pubDate>
            <atom:updated>2023-02-06T19:18:52.350Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pAg44mtT6WSxrrc7_CuzyA.jpeg" /></figure><p>SQL, or Structured Query Language, is a powerful programming language used to manage and manipulate data stored in a relational database. As a novice, I’ve learned that understanding how to manipulate the data in SQL is crucial for working with databases and getting better your SQL skills.</p><p>Today, I’ll discuss the fundamentals of SQL data manipulation, like inserting, updating, and deleting data, as well as more advanced strategies for working with large data sets that I’ve used in the past two weeks.</p><p>I’ll be using the sales schema that comes with MySQL workbench.</p><h3>Inserting Data into a Table</h3><p>Inserting data into a table is among the most fundamental SQL tasks. Using the INSERT INTO statement you can insert new rows into a table. For example, in the ‘sales’ database to insert a new row into ‘customers’ table with columns customer_code, custmer_name, and customer_type, you would use the following syntax:</p><pre>INSERT INTO customers(customer_code, custmer_name, customer_type)<br>values (&#39;Cust039&#39;, &#39;Leader&#39;, &#39;Saas&#39;);</pre><p>Remember while inserting, it’s crucial to check that the values you’re inserting into a table correspond to the data types of the column. For instance, you should insert an integer value rather than a string if a column is defined as an INT.</p><h3>Updating Data in a Table</h3><p>Updating data that already exists in a table is another prolific SQL operation. We use the UPDATE statement to change already-existing rows in a table. For example, to change the name of a previously inserted customer from ‘Leader’ to ‘Canon’ in the “customers” table with the customer code “Cus039,” use the SQL statement:</p><pre>UPDATE customers<br>SET custmer_name = &#39;Canon&#39;<br>WHERE customer_code = &#39;Cust039&#39;;</pre><p>Your UPDATE statement must contain a WHERE clause to say specifically which rows should be updated. The new values will be applied to all table rows if there is no WHERE clause.</p><p>If you don’t want to make changes to the original table, the best practice is to create a copy of it. I created a copy of the ‘customers’ table as ‘customes1’ using the SQL statement below.</p><pre>drop table if exists customers1;<br>create table customers1 as<br>(select *<br>from customers);</pre><h3>Deleting Data from a Table</h3><p>You could also need to remove data from a table besides adding and updating data. This can be done by deleting existing rows from a table using the DELETE statement.</p><p>For the previous example, now that I have a duplicate of the “customers” table, I want to delete the row I initially inserted. I use the following SQL statement to do so.</p><pre>DELETE FROM customers <br>WHERE customer_code = &#39;Cust039&#39;;</pre><p>Similar to the UPDATE statement, your DELETE statement must include a WHERE clause to specify which rows should be deleted because, of course, you don’t want to delete all of the rows in the table.</p><h3>Advanced Techniques for Working with Large Sets of Data</h3><p>Working with large data sets can be challenging. However, by using some sophisticated data manipulation techniques, you can handle and manipulate your data accurately.</p><h4>The LIMIT clause</h4><p>The LIMIT clause is one of the most potent methods for manipulating data in MySQL. When working with large tables, it enables you to specify the number of rows that should be returned. For example, the following SQL statement returns the first ten rows of the “customers” table:</p><pre>SELECT * FROM customers <br>LIMIT 10;</pre><h4>Subqueries</h4><p>With the help of subqueries, you can use SELECT statements to nest one inside another, retrieving data based on the output of another query. A subquery’s primary function is to retrieve data that will be employed in the main query. This enables you to carry out more intricate data manipulation and analysis as well as utilize your database resources more effectively.</p><p>Let’s take a look at the following example of subquery using the both “transactions” and “customers” tables from the same database.</p><pre>SELECT *<br>FROM  sales.transactions<br>WHERE customer_code in (               <br>                SELECT customer_code <br>                FROM  sales.customers <br>                WHERE  customer_type=&#39;E-Commerce&#39;);</pre><p>In this example, the subquery retrieves the customer code of the ‘E-Commerce’ customer type from the “customers” table. The result of the subquery is then used in the main query to filter the data from the “transactions” table to only include transactions made by that customer in the ‘E-Commerce’ sector.</p><h4>Creating And Using Stored Procedure</h4><p>Stored procedures are pre-compiled SQL statements that can be executed repeatedly. With stored procedures, you can package up intricate logic into a single, reusable code block that can be run with just a single call.</p><p>Let’s examine how stored procedures can be utilized in the context of the “transactions” table that has the following columns: product_code, customer_code, market_code, order_date, sales_qty, sales_amount, and currency.</p><pre>DELIMITER //<br>CREATE PROCEDURE GetSales (IN currency_new VARCHAR(45))<br>BEGIN<br>    SELECT SUM(sales_amount)<br>    FROM transactions<br>    WHERE currency = currency_new;<br>END //<br>DELIMITER ;</pre><p>In this example, the stored procedure takes an input parameter currency_new and returns the total sales amount for each currency. The SUM function is used to calculate the total sales amount for each market</p><pre>CALL GetSales(&#39;USD&#39;);</pre><p>In this case, the stored procedure returns the total sales amount for transactions completed in USD. To obtain the total sales amount for various currencies, you can use a different currency when calling the stored procedure.</p><h4>Creating Index</h4><p>Data structures called indexes can be used to speed up database query execution. It is quicker to retrieve data based on those values when there is an index that stores a mapping between the values in a given column and the corresponding row in a table. I’ll use the transactions table to show how to use indexes in MySQL.</p><pre>CREATE INDEX idx_order_date ON transactions (order_date);</pre><p>Here, the order_date column in the transactions table serves as the basis for the index. The index, dubbed idx_order_date, can be used to speed up data search and sort operations based on the order date column.</p><h4>Using Common Table Expressions (CTEs)</h4><p>The use of temporary tables, CTEs, is another important SQL data manipulation technique. It is possible to refer to a temporary result set that is stored in temporary tables from the main query.<br>CTEs are useful for breaking down complex queries into smaller portions.</p><pre>WITH sales_by_market AS (<br>  SELECT market_code, SUM(sales_amount) AS total_sales<br>  FROM transactions<br>  GROUP BY market_code<br>)<br>SELECT market_code, total_sales<br>FROM sales_by_market<br>ORDER BY total_sales DESC<br>LIMIT 5;</pre><p>In this example, a CTE named sales_by_market is created to calculate the total sales for each market by using the GROUP BY clause. In the main query, the top 5 markets are then chosen based on their total sales, and the output is sorted in descending order.</p><p>Instead of performing the same calculation within the main query, CTEs make the code much more readable and understandable. By doing so, errors are less likely to be introduced into the code in the future.</p><p>Please let me know if there is anything I should change or correct. Say hello on <a href="https://www.linkedin.com/in/nadia-ns11/">Linkedin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4134ebbb433d" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/data-manipulation-in-sql-a-concise-overview-4134ebbb433d">Data Manipulation In SQL: A Concise Overview</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My First Power Bi Dashboard Project]]></title>
            <link>https://nadia-sultana.medium.com/my-first-power-bi-dashboard-project-b9a7c0f28d1f?source=rss-131e6a9aed64------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9a7c0f28d1f</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Nadia Sultana]]></dc:creator>
            <pubDate>Sun, 13 Nov 2022 20:19:17 GMT</pubDate>
            <atom:updated>2022-11-13T20:35:33.806Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Stop doubting, time to start a project.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NO5VbPsEfs6dxvo4Hkz_EQ.jpeg" /></figure><h4><strong>How did I start my first dashboard project?</strong></h4><p>I was only four days into learning Power Bi or data visualization in general. On LinkedIn, I saw Ian Klosowicz, one of my favorite Data Analysts, post about a dashboard challenge. Ian assisted me in shaping a roadmap for becoming a data analyst. I began learning SQL and Power BI on his advice. He made a post about his dataset and hosted a dashboard challenge. Despite the fact that I knew practically nothing about it, I chose to participate. I worked on the project you see in the picture for 5 days.</p><h4><strong>Step 1: Data cleaning and transformation</strong></h4><p>The first and most important thing you should do before beginning the visualization is to clean up your data. And you begin by observing your data to determine how you can transform it later to meet your visualization needs. The dataset was titled “Aliens of America” and contained three worksheets.</p><p>Let’s look at Ian’s question:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*90nPM_SL-qjhyqSXgHio2Q.jpeg" /></figure><p>So I used Power Bi to clean and transform the data, including removing blank cells and duplicates. Then I realized I could model the data using their respective IDs. Not sure if what I did was correct. I was only trying it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ej05jPZSEITbMYkEkzgDg.jpeg" /></figure><h4>Step 2: Visualizing the data with charts &amp; graphs</h4><p>As a beginner, I mostly dragged and dropped to create my first dashboard. And it’s a lot of fun and excitement when you start working on your first project.</p><p>As shown in the image below, the dataset contained information on 50K aliens with an average age of 118. To calculate the average age, I used “gauge” from the visualization pane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*jOaMP_pww4GxWZ_DKl0wYw.jpeg" /></figure><p><em>Q-1: If these aliens were hostile</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VT-U7yAVT-rgvkfV60bLwQ.jpeg" /></figure><p>I used this ribbon chart to determine whether or not those aliens were hostile, and then I summarized the data to get the information in the text box. As you can see, the number of hostile aliens was relatively low. With a percentage of 5.46%, Texas had the highest concentration of hostile or aggressive aliens, whereas Vermont had the lowest concentration of aliens overall.</p><p><em>Q-2: Their diet</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*wCJ5YMn3pHUuPzQkbm3wjw.jpeg" /></figure><p>The image above depicts aggressive and non-aggressive aliens’ top five favorite foods when they were around 118 years old.</p><p>So I came to the conclusion that we could try feeding them food like Cattle Egret, Lapwing, whale, blue crane, painted stork, and so on to keep those hostile aliens sane.</p><p>I also created some additional visualizations for their occupation and type because I wanted to include that information in my dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*8lzZrhypn1LuxkAlYVwVRQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*CRDIYg8B_-sO_-zzqDYEIg.jpeg" /></figure><p>I also had a food frequency matrix prepared, which I don’t believe was of any use. Let me know if you find this useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*FZV9JFKlE8MyOPLOsEQYhQ.jpeg" /></figure><h4>Conclusion:</h4><p>Working on my first dashboard was a lot of fun. I learned a lot and tried to do one visualization every day. Every time I was stuck, I looked things up on Google and YouTube. Watching others create dashboards and come up with reasons for using different visualizations provided me with a wealth of data visualization knowledge.</p><p>If you want to play around with this dataset and try out different types of visualizations, you can get it here: <a href="http://Aliens of America">Aliens of America</a>.</p><p>If you have any questions or suggestions, please say hello on <a href="https://www.linkedin.com/in/nadia-ns11/">Linkedin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9a7c0f28d1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let's Talk About Data Analysis]]></title>
            <link>https://nadia-sultana.medium.com/lets-talk-about-data-analysis-63786c0e69b4?source=rss-131e6a9aed64------2</link>
            <guid isPermaLink="false">https://medium.com/p/63786c0e69b4</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[students]]></category>
            <dc:creator><![CDATA[Nadia Sultana]]></dc:creator>
            <pubDate>Thu, 29 Sep 2022 11:54:03 GMT</pubDate>
            <atom:updated>2022-09-29T11:57:22.137Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Data Analysis Roadmap" src="https://cdn-images-1.medium.com/max/1024/1*u1hhKQigPO6UzH8b203Stw.png" /></figure><p>Data analysis is the methodical application of logical and/or statistical approaches to describe and demonstrate, summarize and assess, and evaluate information. Sounds challenging, huh? I’ll put it this way: Data analysis is the process of extracting information and insights from jumbled data. The goal of data analysis is to draw out information that is helpful so that decisions can be made based on the analysis.</p><p>In this post, I’ll attempt to go over the key steps in the data analysis process.</p><h3><strong>Step One: </strong>Problem Statement</h3><p>The first step in data analysis is to identify the problem. Defining objectives, understanding your goals, formulating a hypothesis, and deciding how to test it. We try to come up with a business problem to solve. For instance, How much money did your shop make this year in sales? What caused this quarter’s decline in sales? Why do we keep losing clients? What are the goals that we hope to accomplish? Thus, these are all necessary elements to begin identifying a problem that can be resolved by data analysis.</p><h3><strong>Step Two: Data Collection</strong></h3><p>Data collecting is the next phase. To perform the data analysis, your team must have access to the necessary data, which you must typically gather from some source or through some procedure.</p><p>A data analyst can assess their hypothesis using the data that has been gathered. Data gathering is typically the first stage in problem-solving. Choosing the data you require is a crucial component of this part. This could be quantitative (numeric) data, like sales statistics, or qualitative (descriptive) data, like customer satisfaction.</p><p>In general, consumer data falls into one of three categories:</p><p><strong>First-party data</strong> is information gathered directly from users by your organization. It could be information from the customer relationship management (CRM) system at your business or transactional tracking data. When your customers, newsletter subscribers, and site visitors interact with your site or marketing or make a purchase, that’s your first-party data.</p><p><strong>Second-party data</strong> or information is the first-party data that one company shares with another. The key advantage of second-party data is that they are typically structured and have a good track record of accuracy. Second-party data includes social media profiles, customer feedback, surveys, website activity such as online purchase history; shipping data, and any other examples of first-party data.</p><p><strong>Third-party data</strong> is data that has been compiled and rented or sold by companies that are not affiliated with your business or users. Data from government, non-profit, or academic organizations. and open data repositories are sources of third-party data.</p><h3><strong>Step Three: Data Cleaning</strong></h3><p>The following step is to clean the data. One piece of advice I have received the most is to clean the data because the data we deal with is always dirty. To achieve better results, we must spend time cleaning the data. Data cleaning primarily entails going through the data and attempting to comprehend it, making necessary corrections, such as removing unnecessary data points, adding structure to unstructured data, filling in major gaps, etc. The cleaning process can be time-consuming, but understanding the data is vital. <br>We can also use R packages and Python libraries like Pandas for thorough data cleaning.</p><h3>Step Four: Analyzing the data</h3><p>We clean the data in order to analyze it. This, in my opinion, is the most exciting aspect of the entire procedure. Here, we try to extract some insights from the data by slicing and dicing it at different levels. For instance, we can examine which product sold the most in our store and which product was the most well-known in a given region, as well as identify patterns and areas of growth. The purpose or issue we are aiming to solve will largely determine how the data is analyzed.</p><p>As we go on, let’s discuss the four categories of data analysis.</p><h3>Descriptive analysis</h3><p>Descriptive analysis identifies what has previously occurred, and it is a common approach that businesses take before moving forward with more in-depth investigations. Descriptive analysis, in my opinion, is best suited for beginners like me. Examples of descriptive analysis include looking at the data and determining if our sales are growing or declining or what’s the rate of our growth. Therefore, this analysis most certainly discusses the fundamentals of what is happening with our business.</p><h3>Diagnostic Analysis</h3><p>Diagnostic analysis is concerned with determining why something occurred. It involves analyzing data to identify the underlying causes of trends and correlations between different variables. You could think of it as the logical progression from utilizing descriptive analysis to finding trends. In other words, it looks into the facts to determine why something happened. For instance, what caused sales to drop in our store? Consequently, identifying potential contributing factors can be helpful. So, if a descriptive analysis solves the “what” portion of the topic, a diagnostic analysis will address the “why” component of the issue.</p><h3>Predictive Analysis</h3><p>Based on past data, predictive analysis predicts what will happen in the future. It examines historical records to determine the future outcome. These analyses are important because most businesses want to know what their future plans are and how they intend to proceed with a project. This is referred to as forecasting. To predict future events, we can use various algorithms such as machine learning, deep learning algorithms, and AI. We will apply these tools or algorithms to our data in order to forecast future events.</p><h3>Prescriptive analysis</h3><p>Prescriptive analysis derives conclusions based on Predictive analysis, advises what to do, and makes recommendations for the future to achieve predicted results. This is the most advanced aspect of the analytics process.<br>For example, we can decide whether to introduce a new product in our store. Whether I should become a data analyst or not. The algorithm that guides Google’s self-driving cars is an excellent example of prescriptive analysis.</p><h3>Step Five: Interpreting The Results</h3><p>Now that we’ve completed our analysis and have our results, the next step is to interpret and share them with others. This part of the analytics process includes presenting the results in a way that is understandable to all types of audiences.<br>We must present the data to the decision makers; it is critical that the internal presentation be completely clear and unambiguous. Data Analysts use reports, dashboards, and interactive visualizations to support their findings. How we interpret and present our results will frequently influence the decision of a decision-maker and the direction of a business.</p><p>This is why it is crucial to present all of the evidence and ensure that our data is comprehensive as it has to be proven factual and based on science. It’s crucial to draw attention to any data gaps or insights that could be interpreted differently. <br>There are numerous visualization tools available for use at various levels. Excel dashboards are popular tools for interpreting and sharing your thoughts without the need for basic coding along with Microsoft Power Bi, Tableau, and so on. Python libraries such as Plotly, Matplotlib, and Seaborn are also available. We must ensure that we sharpen our presentation abilities. The secret to succeeding in our job is communication skills.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63786c0e69b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First Two Months Of Becoming A Data Analyst]]></title>
            <link>https://nadia-sultana.medium.com/first-two-months-of-becoming-a-data-analyst-93bccfc687e7?source=rss-131e6a9aed64------2</link>
            <guid isPermaLink="false">https://medium.com/p/93bccfc687e7</guid>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[career-paths]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Nadia Sultana]]></dc:creator>
            <pubDate>Sun, 25 Sep 2022 15:48:42 GMT</pubDate>
            <atom:updated>2022-10-03T17:00:46.182Z</atom:updated>
            <content:encoded><![CDATA[<p>After graduating in April of this year, I was so lost for a few months that I had no idea what to anticipate when I woke up the next morning. I felt numb. Even though I wasn’t new to data, I was undoubtedly new to analytics, thus things were quite difficult for me to understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gJTxO1QagSQoknKzuD8MrA.jpeg" /></figure><p>As a statistics major, I was aware that the majority of my work would include gathering, analyzing, and interpreting data to produce insights. However, I was unsure about how and where to put this knowledge to use.</p><p>Since there aren’t many possibilities nearby for data-related internships, I was mostly in the dark as someone who wanted to launch her data career in tech or corporate setting. I was unsure about the best route for me to take. Even after much research, I remained uncertain. As soon as I decided to join LinkedIn, I was inspired to begin the actual learning process. <br>I will readily confess that it is absurd for me to claim that despite having a degree in Statistics, I was unaware of the existence of the position of data analyst. You can also read this article on <a href="https://link.medium.com/Ki2XtxstPtb">Data Analysis.</a></p><p>These are the five things I’m doing as of now to kickstart my career as a Data Analyst within the next year:</p><h3><strong>1. Excel(Mining to analytics to dashboard)</strong></h3><p>I’ve observed that Excel is the absolute prerequisite ability for becoming a data analyst. I already knew enough about Excel, but I’m currently engrossed in studying more advanced Excel. I mostly use YouTube to learn almost everything. I have done several analytical projects with Excel that includes pivot table and dashboard. To keep up with real-life projects on excel I’ve added a gig on <a href="https://www.fiverr.com/share/1zYKL0">Fiverr</a>. So if anyone needs help with an Excel problem, please inbox me there. It will also help me gain more experience with real-world problems.</p><p>Resources: <a href="https://www.youtube.com/channel/UCRhUp6SYaJ7zme4Bjwt28DQ/playlists">David Langer On Youtube</a> and <a href="https://www.youtube.com/watch?v=Vl0H-qTclOg&amp;t=7504s">Microsoft Excel Tutorial for Beginners — Full Course</a></p><h3><strong>2. Learning SQL</strong></h3><p>Till now the most exciting part of my journey was learning SQL and I found it interesting. SQL stands for Structured Query Language. it’s a programming language that lets you access and manipulate databases. I have learned SQL fundamentals from Khan academy. It’s a great course for beginners like me, very easy to get the basics of SQL. After finishing this course I signed up for Datacamp SQL fundamentals and SQL Server track and now I practice SQL every day on Datacamp. . SQL is capable of handling larger data sets and multiple tables at the same time. The language is very straightforward and simple to learn. If you’re reading this and want to learn SQL, I advise starting with a course from Khan Academy before moving on to <a href="https://www.datacamp.com/">Datacamp</a>. You can even install their app and use your smartphone to practice for free.</p><p>Some free Resources are: <a href="https://www.khanacademy.org/computing/computer-programming/sql">Intro to SQL: Querying and managing data</a> and <a href="https://www.w3schools.com/sql/">SQL Tutorial — W3Schools</a></p><h3><strong>3. Brushing up the Basics of Statistics</strong></h3><p>A big advantage in this field for me is that I am a Statistics graduate. I don’t have to spend time learning statistics from the basics. I just practice statistical analysis and read two case studies every week. For now, I use SPSS for statistical analysis, a great tool that is widely used in the research field. Almost 80% of research studies are done with SPSS. Anyone can go to YouTube and watch the crash course by <a href="https://www.freecodecamp.org/">freecodecamp.org</a> to get to know this tool better. <a href="https://www.fiverr.com/share/xjxkBQ">Click here</a> if you still need assistance using the tool.</p><p>Some other free resources are: <a href="https://www.khanacademy.org/math/statistics-probability">Statistics and probability</a><br> and <a href="https://www.youtube.com/c/joshstarmer">Statquest </a>for advanced Statistics.</p><h3>4. Learning Data Visualisation and Bi Tools</h3><p>Learning a Bi tool, according to data analysts, is essential to succeed in data analytics. Tableau and Power Bi are the most used visualization tools. These days, Power Bi is gaining in popularity. Visualization is crucial because it reveals unexpected results and offers insights that one might not get from simply looking at the data. Making dashboards in Excel is a simple way for anyone to start developing their data visualization skills. I registered for a Power BI course on Dataquest for data visualization. But the most useful resource has always been YouTube. I have since created dashboards using a variety of datasets and taken part in dashboard challenges on LinkedIn. Right now I’m focused on storytelling with data. If you have a dataset, Inbox me on <a href="https://www.linkedin.com/in/nadia-ns11/">LinkedIn</a>. I would love to use your dataset to create a dashboard.</p><p>Some free resources: <a href="https://www.dataquest.io/path/analyzing-data-with-microsoft-power-bi-skill-path/">Analyzing Data with Microsoft Power BI</a> and <a href="https://www.youtube.com/watch?v=UXhGRVTndQA">Power Bi Full Course With Pavan Lalwani</a></p><h3><strong>5. Joining a Bootcamp</strong></h3><p>I recently joined Digital Women Bootcamp Cohort 4 organized by <a href="https://www.linkedin.com/company/mumswhocode-community/">MumsWhoCode Community</a>, not limited to mothers. All ages of women can access it. Right now I am spending more time doing tasks assigned by the facilitators.</p><h3>My next goal:</h3><p>The next thing I want to do is learn more about Python and R programming. I have a basic understanding of R programming because I had to use it for many academic assignments, and I have learned a little amount of Python from Coursera in lockdown just out of curiosity. It is great that the Digital Women Bootcamp also incorporates data analysis and visualization with Python in the curriculum. In the coming weeks, I&#39;m really looking forward to studying advanced Python and R programming.</p><p>Anyone interested in participating in a data analysis Bootcamp can search MumsWhoCode Community or other communities such as Women In Data, Women In Tech, Women In Cloud, etc. on LinkedIn. In addition to setting up Bootcamp for women, they offer scholarships. So, adhere to them and keep a look out for opportunities.</p><p>Wish me luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93bccfc687e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>