Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sc7Xm-0046Qa-KM for pgsql-general@arkaria.postgresql.org; Thu, 08 Aug 2024 18:07:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sc7Xk-00FsAa-Pr for pgsql-general@arkaria.postgresql.org; Thu, 08 Aug 2024 18:07:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sc7Xk-00FsAS-DC for pgsql-general@lists.postgresql.org; Thu, 08 Aug 2024 18:07:20 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sc7Xi-003ptG-1L for pgsql-general@lists.postgresql.org; Thu, 08 Aug 2024 18:07:19 +0000 Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-81f861f369aso74871539f.0 for ; Thu, 08 Aug 2024 11:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723140436; x=1723745236; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=B8fLhFDMpHYzy1h6U6NGpvzlHI/YUgYRNE6LuLctcio=; b=PE1jjSERfSLn6UhnaD/IZ6PiNa24WD0TFpffJqtH4EhTDlZKBpLm2wpKDhV1HR197X 50IO6RteaBMcFMkThc66RvOpiwfiExdSO3zfJ5O2/1JuhtPqi9uWOQ/ljptchzWPLA8e KIug3aODaAq05xNi6SwqXVKZqlg9++LW1qm4xIk14Wm6bVMpgrKkJXz4uykZzrT5arl/ awSX7uDpyqfuQ2kGq4+F7PYZFlbV6KBZe7w/G5Awu79Vqy68CsPJYGGGUNL3QkRJZmui jGpUYVXUb6E6B/+euej9kEqYHZ6OAM1s+zivbHPyYnFOwoBw6KODYjTt9aan7VTe/SLt Q7cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723140436; x=1723745236; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=B8fLhFDMpHYzy1h6U6NGpvzlHI/YUgYRNE6LuLctcio=; b=wx3T0AyFv2zogz09U7tB1QQEsL2UjXISvL2GDEdR8MdP/2F/aQ5T8Sawwjz6OG/a1A cTQ7veOjYM0J0DVT4NwSBrFVyD+eWzzO+H29rhm2mPRMz4PTNUS4+lyeehYRVPGciL6n jPn0KE0WoyGsmjAgSq2J+h2WRuXr/49L2WOio5fSTDxxqUS4PXLRewukU5FQSLqK+nUd /E8Ud3YxJfQ46jmGHuUsX0PGrqbU4n9qb3bJkpoEcNeyoT8g4tONWuvPSoUlj1/ekj5y hIRT87LPngd3nD44hPjt20FlB206/a0zatEf6146A63ubM3S2gBNjTYm98iv6VLMpaEV dRnw== X-Gm-Message-State: AOJu0YwNK+oaIQYtSmnftsVEnS02Gm661+s//ihQXPErTKeGfNYY/9qu IMsEh7qwvoUr0FkMDa6pvHi3/0/mFleXpHPpMh/nHDuS+nrIsm3mDHB+mmurNWEh/eHd5i7X5wB OBjafE0OCxMdluAfVUYclLtUb5sSolThH X-Google-Smtp-Source: AGHT+IGgx8NHcqq+3vum+m3PXuoCKFD/Ikx+nd40ePOOjPoxTCWblC3k9dZ46jN+v/GfZEmMZQ2bFXRcK6sMUv7mBK8= X-Received: by 2002:a05:6e02:219c:b0:375:acd3:31b3 with SMTP id e9e14a558f8ab-39b5f9f8215mr23761135ab.5.1723140435713; Thu, 08 Aug 2024 11:07:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Anthony Apollis Date: Thu, 8 Aug 2024 20:07:04 +0200 Message-ID: Subject: Re: Destination Table - Condition Amount 0 To: Adrian Klaver Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000091a5a1061f2fe59c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000091a5a1061f2fe59c Content-Type: text/plain; charset="UTF-8" The same code bring in values for FY24, 23 etc. Dont understand why FY25's values are 0. On Thu, 8 Aug 2024 at 18:56, Adrian Klaver wrote: > On 8/8/24 09:35, Anthony Apollis wrote: > > I need your assistance with an ETL process that runs every six months. > > Currently, we are in Calendar Year/FY 2025, which started in July 2024. > > > > The issue is with the "Condition Amount" for FY 2025. Data comes through > > correctly until the "Insert Data Into Task" step (please see the > > attached screenshot). However, it appears that the code responsible for > > the "Update PD Credit" step is not functioning as expected. > > > > image.png > > > > > > The destination table [Turkey - NCD Revenue Reporting Model_Table_Model] > > is receiving data for FY 2025, but the "*Condition Amount*" column > > contains zeros for 2025. Please see the attached sample data for > reference. > > > > To help diagnose the issue, I have included the following: > > > > DDL for all three tables. > > > > Insert/Update scripts for the two tasks as depicted in the screenshot > above. > > > > Sample raw data for the two tables. > > > > SSIS can also be found attached for better understanding > > > > Sample data for the "Insert Data Into > > > > Honestly I have not looked through all the files and probably won't. I > did find this though: > > CASE > WHEN NCD_EXCL."Order Quantity" IS NULL OR NCD_EXCL."Order > Quantity" LIKE 'Excluded' THEN > 0 > WHEN NCD_EXCL."Order Quantity" LIKE 'NCD Valid' THEN > NCD_AMOUNT."Condition Amount" > ELSE > 0 > > which looks suspicious in that it can turn a "Condition Amount" into 0. > > I would start by running the SELECT that this is part of and seeing what > it does to the data and if that is what you want it to do. > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > --00000000000091a5a1061f2fe59c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The same code bring in values for FY24, 23 etc. Dont under= stand why FY25's values are 0.

On Thu, 8 Aug 2024 at 18:56, Adrian Klave= r <adrian.klaver@aklaver.co= m> wrote:
On 8/8/24 09:35, Anthony Apollis wrote:
> I need your assistance with an ETL process that runs every six months.=
> Currently, we are in Calendar Year/FY 2025, which started in July 2024= .
>
> The issue is with the "Condition Amount" for FY 2025. Data c= omes through
> correctly until the "Insert Data Into Task" step (please see= the
> attached screenshot). However, it appears that the code responsible fo= r
> the "Update PD Credit" step is not functioning as expected.<= br> >
> image.png
>
>
> The destination table [Turkey - NCD Revenue Reporting Model_Table_Mode= l]
> is receiving data for FY 2025, but the "*Condition Amount*" = column
> contains zeros for 2025. Please see the attached sample data for refer= ence.
>
> To help diagnose the issue, I have included the following:
>
> DDL for all three tables.
>
> Insert/Update scripts for the two tasks as depicted in the screenshot = above.
>
> Sample raw data for the two tables.
>
> SSIS can also be found attached for better understanding
>
> Sample data for the "Insert Data Into
>

Honestly I have not looked through all the files and probably won't. I =
did find this though:

CASE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0WHEN NCD_EXCL."Order Quantity" = IS NULL OR NCD_EXCL."Order
Quantity" LIKE 'Excluded' THEN
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0WHEN NCD_EXCL."Order Quantity" = LIKE 'NCD Valid' THEN
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NCD_AMOUNT."Condition = Amount"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ELSE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00

which looks suspicious in that it can turn a "Condition Amount" i= nto 0.

I would start by running the SELECT that this is part of and seeing what it does to the data and if that is what you want it to do.

--
Adrian Klaver
adrian.klave= r@aklaver.com

--00000000000091a5a1061f2fe59c--