<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Extract First and Second Transactions Based on Flags in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Extract-First-and-Second-Transactions-Based-on-Flags/m-p/2509948#M104783</link>
    <description>&lt;P&gt;Temp:&lt;BR /&gt;&amp;lt;Initial Load goes here &amp;gt;&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Final:&lt;BR /&gt;Load CUSTOMER,&lt;BR /&gt;Branch,&lt;BR /&gt;[Customer Name],&lt;BR /&gt;[Customer Risk],&lt;BR /&gt;FirstValue([Posting Date]) as [1st Transaction Date],&lt;BR /&gt;FirstValue(TRANSACTION_TYPE )as [1st Transaction Type],&lt;BR /&gt;FirstValue(AMOUNT_IN_OMR) as [1st Transaction Amt]&lt;BR /&gt;Resident Temp&lt;BR /&gt;Group By CUSTOMER,Branch,[Customer Name], [Customer Risk];&lt;/P&gt;&lt;P&gt;Left Join&lt;BR /&gt;LOAD CUSTOMER,&lt;BR /&gt;FirstValue([Posting Date]) as [2nd Transaction Date],&lt;BR /&gt;FirstValue(TRANSACTION_TYPE )as [2nd Transaction Type],&lt;BR /&gt;FirstValue(AMOUNT_IN_OMR) as [2nd Transaction Amt]&lt;BR /&gt;Resident Temp&lt;BR /&gt;Where Sign(AMOUNT_IN_OMR) = '-1'&lt;BR /&gt;Group By CUSTOMER;&lt;/P&gt;&lt;P&gt;DROP Table Temp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Mar 2025 12:11:14 GMT</pubDate>
    <dc:creator>BrunPierre</dc:creator>
    <dc:date>2025-03-14T12:11:14Z</dc:date>
    <item>
      <title>Extract First and Second Transactions Based on Flags</title>
      <link>https://community.qlik.com/t5/App-Development/Extract-First-and-Second-Transactions-Based-on-Flags/m-p/2509647#M104738</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I need assistance with extracting and processing the following data using Qlik Sense Scripting. Below is my current script and the expected output.&lt;/P&gt;&lt;P&gt;ACCOUNT_TRANSACTION:&lt;BR /&gt;LOAD&lt;BR /&gt;CUSTOMER&lt;BR /&gt;DEFAULT_BRANCH,&lt;BR /&gt;"Customer Name",&lt;BR /&gt;"Cust. Onboarded Date",&lt;BR /&gt;"Customer Risk",&lt;BR /&gt;POSTING_DATE,&lt;BR /&gt;TRANSACTION_TYPE,&lt;BR /&gt;MAIN_TYPE,&lt;BR /&gt;CHANNEL,&lt;BR /&gt;AMOUNT_IN_OMR,&lt;/P&gt;&lt;P&gt;// Flag for Same Day Debit&lt;BR /&gt;IF(AMOUNT_IN_OMR &amp;lt; 0 AND Date(Floor(POSTING_DATE)) = Date(Floor(ACCOUNT_OPEN_DATE)), 'Debit Same Day',&lt;BR /&gt;IF(AMOUNT_IN_OMR &amp;lt; 0 AND Date(Floor(POSTING_DATE)) &amp;gt; Date(Floor(ACCOUNT_OPEN_DATE)) AND Date(Floor(POSTING_DATE)) &amp;lt;= Date(Floor(ACCOUNT_OPEN_DATE)) + 7, 'Debit Within 1 Week', 'Not Debit Same Day/Within 1 Week')) AS Debit_Flag,&lt;/P&gt;&lt;P&gt;// Flag for Same Day Credit&lt;BR /&gt;IF(AMOUNT_IN_OMR &amp;gt; 0 AND Date(Floor(POSTING_DATE)) = Date(Floor(ACCOUNT_OPEN_DATE)), 'Credit Same Day',&lt;BR /&gt;IF(AMOUNT_IN_OMR &amp;gt; 0 AND Date(Floor(POSTING_DATE)) &amp;gt; Date(Floor(ACCOUNT_OPEN_DATE)) AND Date(Floor(POSTING_DATE)) &amp;lt;= Date(Floor(ACCOUNT_OPEN_DATE)) + 7, 'Credit Within 1 Week')) AS Credit_Flag&lt;/P&gt;&lt;P&gt;FROM ACCOUNT_TRANSACTION;&lt;/P&gt;&lt;P&gt;Expected Output:&lt;/P&gt;&lt;P&gt;I would like to extract the following fields:&lt;/P&gt;&lt;P&gt;Branch&lt;BR /&gt;Customer Number&lt;BR /&gt;Customer Name&lt;BR /&gt;Customer Risk&lt;BR /&gt;Date of opening account&lt;BR /&gt;Date of first transaction&lt;BR /&gt;First Transaction amount&lt;BR /&gt;First Transaction type&lt;BR /&gt;Date of 2nd Trans&lt;BR /&gt;Second Transaction amount&lt;BR /&gt;Second Transaction type&lt;/P&gt;&lt;P&gt;The First Transaction refers to the earliest transaction for the customer, including the transaction date, amount, and type.&lt;/P&gt;&lt;P&gt;The Second Transaction will be the debit transaction (if any), which follows the first transaction for the same customer.&lt;/P&gt;&lt;P&gt;I also want to include the flags Credit Flag and Debit Flag to capture the transaction types.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 07:09:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extract-First-and-Second-Transactions-Based-on-Flags/m-p/2509647#M104738</guid>
      <dc:creator>RenukaSasikumar15</dc:creator>
      <dc:date>2025-03-13T07:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extract First and Second Transactions Based on Flags</title>
      <link>https://community.qlik.com/t5/App-Development/Extract-First-and-Second-Transactions-Based-on-Flags/m-p/2509948#M104783</link>
      <description>&lt;P&gt;Temp:&lt;BR /&gt;&amp;lt;Initial Load goes here &amp;gt;&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Final:&lt;BR /&gt;Load CUSTOMER,&lt;BR /&gt;Branch,&lt;BR /&gt;[Customer Name],&lt;BR /&gt;[Customer Risk],&lt;BR /&gt;FirstValue([Posting Date]) as [1st Transaction Date],&lt;BR /&gt;FirstValue(TRANSACTION_TYPE )as [1st Transaction Type],&lt;BR /&gt;FirstValue(AMOUNT_IN_OMR) as [1st Transaction Amt]&lt;BR /&gt;Resident Temp&lt;BR /&gt;Group By CUSTOMER,Branch,[Customer Name], [Customer Risk];&lt;/P&gt;&lt;P&gt;Left Join&lt;BR /&gt;LOAD CUSTOMER,&lt;BR /&gt;FirstValue([Posting Date]) as [2nd Transaction Date],&lt;BR /&gt;FirstValue(TRANSACTION_TYPE )as [2nd Transaction Type],&lt;BR /&gt;FirstValue(AMOUNT_IN_OMR) as [2nd Transaction Amt]&lt;BR /&gt;Resident Temp&lt;BR /&gt;Where Sign(AMOUNT_IN_OMR) = '-1'&lt;BR /&gt;Group By CUSTOMER;&lt;/P&gt;&lt;P&gt;DROP Table Temp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 12:11:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Extract-First-and-Second-Transactions-Based-on-Flags/m-p/2509948#M104783</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2025-03-14T12:11:14Z</dc:date>
    </item>
  </channel>
</rss>

