<?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 help me to implement sql query in qlikview in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/help-me-to-implement-sql-query-in-qlikview/m-p/276582#M499273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jul 2011 09:30:59 GMT</pubDate>
    <dc:creator>sushil353</dc:creator>
    <dc:date>2011-07-13T09:30:59Z</dc:date>
    <item>
      <title>help me to implement sql query in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/help-me-to-implement-sql-query-in-qlikview/m-p/276580#M499271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to load data into qlikview file using a sql query. The query is written in such a way that it fetches the data from various tables and load that into a single table...as you can see below there are lot of joints and conditions given and as i am new to this tool please help me out to how we can implement this situation in qlikview to load data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;SELECT&lt;/SPAN&gt; prim.UNIT_ID, &lt;/P&gt;&lt;P&gt;prim.ORIGIN, prim.DESCRIPTION, &lt;/P&gt;&lt;P&gt;prim.PRIMARY_INFO, defect.SECONDARY_INFO, other.OTHER_INFO, prim.UPD_USER DEFECT_USER, prim.UPD_DATE DEFECT_DATE, PRIM.PRD_GROUP PRODUCT, &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FROM &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;SELECT&lt;/SPAN&gt; pd.prd_group,dl_ot_code OPERATION_CODE,dl_st_Station, dl_unit_id UNIT_ID, dl_id DEFECT_LOG_ID, de_id DEFECT_ID, &lt;/P&gt;&lt;P&gt;di_id PRIMARY_ID, dt_origin ORIGIN, dt_description DESCRIPTION,&amp;nbsp; it_type IT_TYPE, di_info PRIMARY_INFO, de_upd_user UPD_USER, &lt;/P&gt;&lt;P&gt;to_char(db_date_location_2_local_date(de_upd_date,1),'MON-DD-YYYY HH24.MI.SS') UPD_DATE, OT_TYPE OPERATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FROM&lt;/SPAN&gt; defect_logs dl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;INNER JOIN &lt;/SPAN&gt;OPERATION_TYPES ON DL_OT_CODE = OT_CODE&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;INNER JOIN&lt;/SPAN&gt; defects de ON dl_id = de_dl_id and de.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LEFT JOIN &lt;/SPAN&gt;defect_info di ON di_de_id = de_id&amp;nbsp; and di.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt; info_types it ON di_it_code = it_code&amp;nbsp; and it.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//TYPES&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;left JOIN&lt;/SPAN&gt; defect_types dt ON de_dt_code = dt_code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//LINK TO PD&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt; units u ON dl_unit_id = u.unit_id&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt; product_designs pd ON NVL(u.start_prd_id,dl_prd_id) = pd.prd_id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//LINK DEFECT LOGS&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt; assembly_logs ON AS_DL_ID = DL_ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;WHERE &lt;/SPAN&gt;(as_op_vernum = 1 OR as_op_vernum IS NULL)&lt;/P&gt;&lt;P&gt;and dl.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;AND &lt;/SPAN&gt;dl_client_id IN &lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;SELECT &lt;/SPAN&gt;client_id&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FROM&lt;/SPAN&gt; ods_na_owner.station_client&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;WHERE&lt;/SPAN&gt; location_code = 1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;AND&lt;/SPAN&gt; stage_code = 1&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND (it_order = 1 OR it_order IS NULL /*IF NO INFO TYPES*/)&lt;/P&gt;&lt;P&gt;AND DI_IT_CODE NOT IN (5,328,394,395)&lt;/P&gt;&lt;P&gt;AND de_upd_date BETWEEN local_date_location_2_db_date(to_date('MAY-01-2011 00:00:00','MON-DD-YYYY HH24.MI.SS'),1)&lt;/P&gt;&lt;P&gt;AND local_date_location_2_db_date(to_date('JUL-05-2011 23:59:59','MON-DD-YYYY HH24.MI.SS'),1)&lt;/P&gt;&lt;P&gt;AND prd_group IN ('R040 (768)','R040 Slider')&lt;/P&gt;&lt;P&gt;AND dt_origin IN ('PROCESS','COMPONENT')&lt;/P&gt;&lt;P&gt;) prim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;SELECT &lt;/SPAN&gt;de_id DEFECT_ID, NVL(di_id,'') SECONDARY_ID, di_info SECONDARY_INFO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FROM&lt;/SPAN&gt; defect_info&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;INNER JOIN &lt;/SPAN&gt;info_types ON it_code = di_it_code and info_types.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;INNER JOIN&lt;/SPAN&gt; defects ON de_id = di_de_id&amp;nbsp; and defects.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;WHERE&lt;/SPAN&gt; di_it_code IN (328,394,395,585)&lt;/P&gt;&lt;P&gt;and defect_info.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;) defect ON prim.DEFECT_ID = defect.DEFECT_ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;SELECT&lt;/SPAN&gt; de_id DEFECT_ID, NVL(di_id,'') OTHER_ID, di_info OTHER_INFO&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FROM&lt;/SPAN&gt; defect_info&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;INNER JOIN&lt;/SPAN&gt; info_types ON it_code = di_it_code&amp;nbsp; and info_types.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;INNER JOIN&lt;/SPAN&gt; defects ON de_id = di_de_id&amp;nbsp; and defects.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;WHERE&lt;/SPAN&gt; di_it_code IN (5)&lt;/P&gt;&lt;P&gt;and defect_info.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;) other ON prim.DEFECT_ID = other.DEFECT_ID&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 08:31:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-me-to-implement-sql-query-in-qlikview/m-p/276580#M499271</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2011-07-13T08:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: help me to implement sql query in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/help-me-to-implement-sql-query-in-qlikview/m-p/276581#M499272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure, but have you tried : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;QVTable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;SQL SELECT&lt;/SPAN&gt; prim.UNIT_ID,&lt;/P&gt;&lt;P&gt;prim.ORIGIN, prim.DESCRIPTION,&lt;/P&gt;&lt;P&gt;prim.PRIMARY_INFO, defect.SECONDARY_INFO, other.OTHER_INFO, prim.UPD_USER DEFECT_USER, prim.UPD_DATE DEFECT_DATE, PRIM.PRD_GROUP PRODUCT,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;SELECT&lt;/SPAN&gt; pd.prd_group,dl_ot_code OPERATION_CODE,dl_st_Station, dl_unit_id UNIT_ID, dl_id DEFECT_LOG_ID, de_id DEFECT_ID,&lt;/P&gt;&lt;P&gt;di_id PRIMARY_ID, dt_origin ORIGIN, dt_description DESCRIPTION,&amp;nbsp; it_type IT_TYPE, di_info PRIMARY_INFO, de_upd_user UPD_USER,&lt;/P&gt;&lt;P&gt;to_char(db_date_location_2_local_date(de_upd_date,1),'MON-DD-YYYY HH24.MI.SS') UPD_DATE, OT_TYPE OPERATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;FROM&lt;/SPAN&gt; defect_logs dl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;INNER JOIN &lt;/SPAN&gt;OPERATION_TYPES ON DL_OT_CODE = OT_CODE&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;INNER JOIN&lt;/SPAN&gt; defects de ON dl_id = de_dl_id and de.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;LEFT JOIN &lt;/SPAN&gt;defect_info di ON di_de_id = de_id&amp;nbsp; and di.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt; info_types it ON di_it_code = it_code&amp;nbsp; and it.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//TYPES&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;left JOIN&lt;/SPAN&gt; defect_types dt ON de_dt_code = dt_code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//LINK TO PD&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt; units u ON dl_unit_id = u.unit_id&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt; product_designs pd ON NVL(u.start_prd_id,dl_prd_id) = pd.prd_id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//LINK DEFECT LOGS&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt; assembly_logs ON AS_DL_ID = DL_ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;WHERE &lt;/SPAN&gt;(as_op_vernum = 1 OR as_op_vernum IS NULL)&lt;/P&gt;&lt;P&gt;and dl.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;AND &lt;/SPAN&gt;dl_client_id IN&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;SELECT &lt;/SPAN&gt;client_id&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;FROM&lt;/SPAN&gt; ods_na_owner.station_client&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;WHERE&lt;/SPAN&gt; location_code = 1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;AND&lt;/SPAN&gt; stage_code = 1&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND (it_order = 1 OR it_order IS NULL /*IF NO INFO TYPES*/)&lt;/P&gt;&lt;P&gt;AND DI_IT_CODE NOT IN (5,328,394,395)&lt;/P&gt;&lt;P&gt;AND de_upd_date BETWEEN local_date_location_2_db_date(to_date('MAY-01-2011 00:00:00','MON-DD-YYYY HH24.MI.SS'),1)&lt;/P&gt;&lt;P&gt;AND local_date_location_2_db_date(to_date('JUL-05-2011 23:59:59','MON-DD-YYYY HH24.MI.SS'),1)&lt;/P&gt;&lt;P&gt;AND prd_group IN ('R040 (768)','R040 Slider')&lt;/P&gt;&lt;P&gt;AND dt_origin IN ('PROCESS','COMPONENT')&lt;/P&gt;&lt;P&gt;) prim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;SELECT &lt;/SPAN&gt;de_id DEFECT_ID, NVL(di_id,'') SECONDARY_ID, di_info SECONDARY_INFO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;FROM&lt;/SPAN&gt; defect_info&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;INNER JOIN &lt;/SPAN&gt;info_types ON it_code = di_it_code and info_types.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;INNER JOIN&lt;/SPAN&gt; defects ON de_id = di_de_id&amp;nbsp; and defects.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;WHERE&lt;/SPAN&gt; di_it_code IN (328,394,395,585)&lt;/P&gt;&lt;P&gt;and defect_info.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;) defect ON prim.DEFECT_ID = defect.DEFECT_ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;LEFT JOIN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;SELECT&lt;/SPAN&gt; de_id DEFECT_ID, NVL(di_id,'') OTHER_ID, di_info OTHER_INFO&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;FROM&lt;/SPAN&gt; defect_info&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;INNER JOIN&lt;/SPAN&gt; info_types ON it_code = di_it_code&amp;nbsp; and info_types.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;INNER JOIN&lt;/SPAN&gt; defects ON de_id = di_de_id&amp;nbsp; and defects.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; color: #0000ff;"&gt;WHERE&lt;/SPAN&gt; di_it_code IN (5)&lt;/P&gt;&lt;P&gt;and defect_info.delete_ods_dt is null&lt;/P&gt;&lt;P&gt;) other ON prim.DEFECT_ID = other.DEFECT_ID&lt;/P&gt;&lt;/PRE&gt;&lt;PRE __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;/PRE&gt;&lt;PRE __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 08:38:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-me-to-implement-sql-query-in-qlikview/m-p/276581#M499272</guid>
      <dc:creator>martin59</dc:creator>
      <dc:date>2011-07-13T08:38:01Z</dc:date>
    </item>
    <item>
      <title>help me to implement sql query in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/help-me-to-implement-sql-query-in-qlikview/m-p/276582#M499273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 09:30:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/help-me-to-implement-sql-query-in-qlikview/m-p/276582#M499273</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2011-07-13T09:30:59Z</dc:date>
    </item>
  </channel>
</rss>

