Qlikview no data generated

房东的猫 提交于 2019-12-14 03:06:55

问题


I have a fact table that left join v_gate_pm_trip with v_fate_pm_trip_cntr. I was able to generate the qvd by by the month name of the date (arrive)dt) howerver, when it load * from resident fact, no data is being fetch for all month.

FACT:
LOAD "TRIP_ID",
    "PM_M",
    "ARRIVE_DT",
    MonthName("ARRIVE_DT") as MONTH_NAME, //find out the monthname present in the data
SQL SELECT *
FROM EODWADMIN."V_GATE_PM_TRIP";

LEFT JOIN 

LOAD "TRIP_ID",
    "CREATE_DT",
    "MODIFIED_DT";
SQL SELECT *
FROM EODWADMIN."V_GATE_PM_TRIP_CNTR";

// Start looping through each distinct value in the Month field
for i = 1 to FieldValueCount('MONTH_NAME')
    // In-loop variable that will get the current increment value from the Month field
    let sMonhValue = FieldValue('MONTH_NAME', $(i));
    trace Storing data for MONTH_NAME --> $(sMonhValue);

    // NoConcatenate is used to tell Qlik to not concatenate the same tables
    NoConcatenate

    // Load the data for the current iteration month from the main data table
    TempTable:
    Load
      *
    Resident
      FACT
    where
      MONTH_NAME = $(i) order by ARRIVE_DT;

    // Store one month data in qvd. The name of the qvd will include the month value        
    Store TempTable into FACT_$(sMonhValue).qvd;

    // If the qvd files need to be stored somewhere else - just provide the path like:
    //Store TempTable into c:\users\UserName\Documents\RandData_$(sMonhValue).qvd;

    // Drop the temp table. Otherwise it will get concatenated to the "previos" temp table 
    Drop Table TempTable;
next

// At the end the app will contain only one table - `RandData`

回答1:


Something strange about the "where MONTH_NAME = $(i) order by ARRIVE_DT;" part.

$(i) is a number, from the loop, should you be using "where MONTH_NAME = '$(sMonhValue )' order by ARRIVE_DT;"?




回答2:


Where MONTH_NAME = '$(sMonhValue)'



来源:https://stackoverflow.com/questions/52162398/qlikview-no-data-generated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!