1 Reply Latest reply: Aug 16, 2016 10:57 AM by Gysbert Wassenaar RSS

    Break Loops

    Govind Ramchetty

      Hi

      I am using qlik sense.

       

      I have 2 fact tables and 2 Dim tables.

       

      I joined

       

      Dim1.Date_key=Fact1.Date_Key

      Dim1.Inv_key=Fact1.Inv_Key

      and

      Dim2.Date_key=Fact2.Date_Key

      Dim2.Inv_key=Fact2.Inv_Key

      Please find the attachment for joining.

      I am getting loop error.How can i fix.

       

      My Original query is

      [EXP_F_EXPENSE]:

      SELECT "RECORD_DATE_KEY" AS "DATE_KEY",

        "COMPANY_KEY",

        "ACFT_KEY",

        "AIRCRAFT_UNIT_KEY",

        "GL_ACCOUNT_KEY" AS "EXP_FACT_GL_ACCOUNT_KEY",

        "INV_KEY",

        "INV_LINE_ITEM_KEY",

        "FLEET_KEY",

        "LOCATION_KEY",

        "FACT_SK",

        "ORD_LINE_ITEM_KEY",

        "SERVICE_LOCATION",

        "SUPPLIER_LOCATION",

        "ORD_KEY",

        "SUP_ITEM_KEY",

        "ATA_KEY",

        "SUP_KEY",

        "EXP_CLASS_CD" AS "EXP_FACT_EXP_CLASS_CD",

        "EXP_DIVISION_CD" AS "EXP_FACT_EXP_DIVISION_CD",

        "EXP_COST_ROLLUP_CD" AS "EXP_FACT_EXP_COST_ROLLUP_CD",

        "EXP_COST_ACCOUNT_CD" AS "EXP_FACT_EXP_COST_ACCOUNT_CD",

        "EXP_COST_SUBCATEGORY_CD",

        "INVOICED_RATE",

        "INVOICED_QUANTITY",

        "INVOICE_LINE_TOTAL",

        "DISPUTED_AMOUNT",

        "CLAIM_LINE_ITEM_SUM",

        "DEBIT_LINE_ITEM_SUM",

        "CREDIT_LINE_ITEM_SUM",

        "ACTUAL_EXPENSE",

        "ACCRUAL_EXPENSE",

        "GRAND_TOTAL_EXPENSE",

        "ACCRUAL_IND",

        "DISTRIBUTED_DT",

        "APPROVED_DT"

      FROM "EXP_F_EXPENSE";

       

       

      [EXP_D_DATE]:

      SELECT "DATE_KEY",

        "DATE_KEY" AS "GL_DATE_KEY",

        "COMPANY_KEY" AS "COMPANY_KEY_DATE",

          "DATE_VALUE",

        "DAY_OF_WEEK_NBR",

        "DAY_OF_WEEK_DESC",

        "DAY_OF_WEEK_SHORT_DESC",

        "WEEK_END_FLG",

        "WEEK_IN_MONTH_NBR",

        "WEEK_IN_YEAR_NBR",

        "WEEK_START_DT",

        "WEEK_END_DT",

        "DAY_OF_MONTH_NBR",

        "MONTH_VALUE",

        "MONTH_DESC",

        "MONTH_SDESC",

        "MONTH_START_DT",

        "MONTH_END_DT",

        "DAYS_IN_MONTH_NBR",

        "LAST_DAY_OF_MONTH_FLG",

        "DAY_OF_QUARTER_NBR",

        "QUARTER_VALUE",

        "QUARTER_DESC",

        "QUARTER_START_DT",

        "QUARTER_END_DT",

        "YEAR_QRTR_VALUE",

        "ACC_QRTR_VALUE",

        "ACC_YEAR_MONTH_VALUE",

        "ACC_YEAR_VALUE",

        "LAST_DAY_OF_QUARTER_FLG",

        "DAY_OF_YEAR_NBR",

        "YEAR_VALUE",

        "YEAR_MONTH_VALUE",

        "PRIOR_YEAR_VALUE",

        "PRIOR_YEAR_QRTR_VALUE",

        "PRIOR_QRTR_VALUE",

        "FIRST_DAY_OF_MONTH_FLG",

        "FIRST_DAY_OF_WEEK_FLG",

        "FIRST_DAY_OF_QRTR_FLG",

        "FIRST_DAY_OF_YEAR_FLG"

      FROM "EXP_D_DATE";

       

       

       

       

      [EXP_D_INVOICE]:

      SELECT "INV_KEY",

        "INV_KEY" AS "GL_INV_KEY",

        "BATCH_KEY",

        "COMPANY_KEY" as "COMPANY_KEY_INVOICE",

        "SUPPLIER_KEY",

        "INV_SOURCE_NM",

        "SUPPLIER_INV_NBR",

        "INV_SUBJECT_AREA_DESC",

        "INV_TYPE_DESC",

        "INV_CREATE_DT",

        "INV_CREATED_BY_USERNM",

        "INV_DT",

        "INV_STATUS_CD",

        "INV_STATUS_NM",

        "INV_APPROVED_DT",

        "BATCH_TRANSFER_ID",

        "INV_LOCATION_KEY",

        "REMIT_TO_VENDOR_ID",

        "FR_GL_POSTED_DT",

        "GMP_COVERAGE_YRMO",

        "GMP_TRANS_YRMO"

      FROM "EXP_D_INVOICE";

       

       

      [EXP_F_GL]:

      SELECT "GL_KEY",

        "GL_ACCOUNT_KEY",

        "SUP_KEY" AS "GL_SUP_KEY",

        "INV_KEY" AS "GL_INV_KEY",

        "DATE_KEY" AS "GL_DATE_KEY",

        "ACFT_KEY" AS "GL_ACFT_KEY",

        "COMPANY_KEY" AS "GL_COMPANY_KEY",

        "FLEET_KEY" AS "GL_FLEET_KEY",

        "GL_ACCOUNT_NBR",

        "EXP_CLASS_CD",

        "EXP_DIVISION_CD",

        "EXP_COST_ROLLUP_CD",

        "EXP_COST_ACCOUNT_CD",

        "INV_NBR",

        "VENDOR_ID",

        "GL_ENTRY_DT",

        "GL_POSTED_DT",

        "INV_DT" AS "GL_INV_DT",

        "EXPENSED_AMOUNT",

        "CREDIT_AMOUNT"

      FROM "EXP_F_GL";

       

      Can you please help how can i break loops