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 1sc6RG-003vmB-Fz for pgsql-general@arkaria.postgresql.org; Thu, 08 Aug 2024 16:56:34 +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 1sc6RF-00FQfu-0h for pgsql-general@arkaria.postgresql.org; Thu, 08 Aug 2024 16:56:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sc6RD-00FQfl-B1 for pgsql-general@lists.postgresql.org; Thu, 08 Aug 2024 16:56:32 +0000 Received: from fout1-smtp.messagingengine.com ([103.168.172.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sc6RA-003jpg-8y for pgsql-general@lists.postgresql.org; Thu, 08 Aug 2024 16:56:30 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id BDCBB138FC27; Thu, 8 Aug 2024 12:56:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 08 Aug 2024 12:56:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1723136186; x=1723222586; bh=a9LcBdxHkl5qPyuEytCMqOHxhdnAn1vpColBoSRTC5g=; b= NBXUTJQz7nl+rr301+4+EEP3/RgraEjUCz741bskXnGltt/FqGeekmgce1FIEgxh PjDTAazbapqKOV7DI4EEeVA+3GsdS/4XwUSRTcLbZG+XpbdAzzFHk1roEWr16Rz3 zhpOuquXS8tBpyuKAVjH4kOsJIENFSc+7qKeLbqOwYYqm/7SAIHRO5ryNobq77BH zeLPSVmBfBlaUP6HTWor1D1Izjv3sNZWaiEIdIsNYjipQK3Rtp9enX324Jtfl+3L TSv1xIQPwfM5J+ZCnAfEE/2Uulnu1uFNxMJ53EN7Hq/X/DgHz6dTKuJ0Y5nx7Jkg 4CLkOwh3TTfxT/VCnLZfyw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1723136186; x= 1723222586; bh=a9LcBdxHkl5qPyuEytCMqOHxhdnAn1vpColBoSRTC5g=; b=M HUFLozlOeoR/DqT0ujrhHbkFsOwt88Ib48MJvnGKO4Mj9NqIj6Xrk5fpx8JA355d Y6KPCwNHYb7JbQv9UL0OkvdVAxVU7CTRLSlxckA4zIlZVsTe+bcF2L3ENGKyCZNM JOlxIay1tLRzjqAJgpLJEE/4RoZrTY/8PCbCcyeZGa00xssXYTtTefWlIsari32i LtVlrfDqACXIPrF4k3ZPojeL3NNm6uUgcV+MTzWCJhnV6VoN/wyL+W48V0N4Lb6e n+876dAFTFMoQJUliIX3Kf0JGdynbRozcFAEZ0Dq/t01UdaSht1eaFs8R5wH6+u9 YpS6J1/lIwumTYQeZJFvQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrledvgddutdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeen ucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeeivdfhieehheegueeileej ieettdejhedugeefleekvdelkeehtdfgiefffeekudenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhl rghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopegrnhhthhhonhihrdgrphholhhlihhssehgmhgrihhlrdgtohhmpdhrtghp thhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvghsqhhlrd horhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Aug 2024 12:56:26 -0400 (EDT) Message-ID: Date: Thu, 8 Aug 2024 09:56:25 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Destination Table - Condition Amount 0 To: Anthony Apollis , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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