<?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 Please Help. How to create a script for fact table. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Please-Help-How-to-create-a-script-for-fact-table/m-p/253276#M1206312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Here is detail. Can someone please help me with script to create a fact table. Would really appreciate. I am totally new with Qlikview scripting.&lt;/P&gt;&lt;P&gt;Project_Detail: // (first - SQL view)&lt;BR /&gt;SQL select distinct&lt;BR /&gt;a.ProjectUID,&lt;BR /&gt;a.ProjectName,&lt;BR /&gt;a.ProjectAuthorName,&lt;BR /&gt;a.ProjectCost,&lt;BR /&gt;b.Start_Date,&lt;BR /&gt;b.Finish_Date,&lt;BR /&gt;b.Created_Date,&lt;BR /&gt;from&lt;BR /&gt;dbo.Table1 a inner join&lt;BR /&gt;dbo.Table2 b on a.ProjectUID = b.PROJ_UID&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ProjectCountbystatusbybusiness: // (Second - SQL View)&lt;BR /&gt;SQL Select&lt;BR /&gt;'ProjectCount' = CASE&lt;BR /&gt;when c.LT_VALUE_TEXT = 'Cancelled' then COUNT(c.VALUE)&lt;BR /&gt;when c.LT_VALUE_TEXT = 'Close' then COUNT(c.VALUE)&lt;BR /&gt;when c.LT_VALUE_TEXT = 'Complete' then COUNT(c.VALUE)&lt;BR /&gt;ELSE '' END,&lt;BR /&gt;a.[Business Unit] as Business_Units,&lt;BR /&gt;c.VALUE as Project_Status&lt;BR /&gt;from&lt;BR /&gt;dbo.Table1 a inner join&lt;BR /&gt;dbo.Table2 b on a.ProjectUID = b.PROJ_UID inner join&lt;BR /&gt;dbo.Table3 c on b.UID = c.UID&lt;BR /&gt;group by a.[Business Unit], c.VALUE&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;BusinessUnits_Lookup: // (first - lookup table)&lt;BR /&gt;SQL select distinct [Business Unit] as Business_Units,&lt;BR /&gt;from dbo.Table1;&lt;/P&gt;&lt;P&gt;ProjectStatus_Lookup: // (second - lookup table)&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Project_Status&lt;BR /&gt;Cancelled&lt;BR /&gt;Close&lt;BR /&gt;Complete];&lt;/P&gt;&lt;P&gt;In the above four tables, I don't know how to create a fact table because Project_Detail has no fields to link with other tables. ProjectCountbystatusbybusiness can link easily with other two lookup tables. I am trying to do something like following but unsuccessful, need help here: I thought I need a fact table to accomplish the task and trying to create some script. Please assist.&lt;/P&gt;&lt;P&gt;Projects:&lt;BR /&gt;LOAD&lt;BR /&gt;ProjectUID, ProjectName, ProjectAuthorName, ProjectCost, Start_Date, Finish_Date, Created_Date,&lt;BR /&gt;applymap('BusinessUnits_Lookup ',Business_Units),&lt;BR /&gt;applymap('ProjectStatus_Lookup ',Project_Status)&lt;BR /&gt;resident Project_Detail;&lt;BR /&gt;LEFT JOIN&lt;BR /&gt;LOAD&lt;BR /&gt;ProjectCount, Business_Units, Project_Status&lt;BR /&gt;resident ProjectCountbystatusbybusiness;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Apr 2010 04:30:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-04-23T04:30:09Z</dc:date>
    <item>
      <title>Please Help. How to create a script for fact table.</title>
      <link>https://community.qlik.com/t5/QlikView/Please-Help-How-to-create-a-script-for-fact-table/m-p/253276#M1206312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Here is detail. Can someone please help me with script to create a fact table. Would really appreciate. I am totally new with Qlikview scripting.&lt;/P&gt;&lt;P&gt;Project_Detail: // (first - SQL view)&lt;BR /&gt;SQL select distinct&lt;BR /&gt;a.ProjectUID,&lt;BR /&gt;a.ProjectName,&lt;BR /&gt;a.ProjectAuthorName,&lt;BR /&gt;a.ProjectCost,&lt;BR /&gt;b.Start_Date,&lt;BR /&gt;b.Finish_Date,&lt;BR /&gt;b.Created_Date,&lt;BR /&gt;from&lt;BR /&gt;dbo.Table1 a inner join&lt;BR /&gt;dbo.Table2 b on a.ProjectUID = b.PROJ_UID&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ProjectCountbystatusbybusiness: // (Second - SQL View)&lt;BR /&gt;SQL Select&lt;BR /&gt;'ProjectCount' = CASE&lt;BR /&gt;when c.LT_VALUE_TEXT = 'Cancelled' then COUNT(c.VALUE)&lt;BR /&gt;when c.LT_VALUE_TEXT = 'Close' then COUNT(c.VALUE)&lt;BR /&gt;when c.LT_VALUE_TEXT = 'Complete' then COUNT(c.VALUE)&lt;BR /&gt;ELSE '' END,&lt;BR /&gt;a.[Business Unit] as Business_Units,&lt;BR /&gt;c.VALUE as Project_Status&lt;BR /&gt;from&lt;BR /&gt;dbo.Table1 a inner join&lt;BR /&gt;dbo.Table2 b on a.ProjectUID = b.PROJ_UID inner join&lt;BR /&gt;dbo.Table3 c on b.UID = c.UID&lt;BR /&gt;group by a.[Business Unit], c.VALUE&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;BusinessUnits_Lookup: // (first - lookup table)&lt;BR /&gt;SQL select distinct [Business Unit] as Business_Units,&lt;BR /&gt;from dbo.Table1;&lt;/P&gt;&lt;P&gt;ProjectStatus_Lookup: // (second - lookup table)&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Project_Status&lt;BR /&gt;Cancelled&lt;BR /&gt;Close&lt;BR /&gt;Complete];&lt;/P&gt;&lt;P&gt;In the above four tables, I don't know how to create a fact table because Project_Detail has no fields to link with other tables. ProjectCountbystatusbybusiness can link easily with other two lookup tables. I am trying to do something like following but unsuccessful, need help here: I thought I need a fact table to accomplish the task and trying to create some script. Please assist.&lt;/P&gt;&lt;P&gt;Projects:&lt;BR /&gt;LOAD&lt;BR /&gt;ProjectUID, ProjectName, ProjectAuthorName, ProjectCost, Start_Date, Finish_Date, Created_Date,&lt;BR /&gt;applymap('BusinessUnits_Lookup ',Business_Units),&lt;BR /&gt;applymap('ProjectStatus_Lookup ',Project_Status)&lt;BR /&gt;resident Project_Detail;&lt;BR /&gt;LEFT JOIN&lt;BR /&gt;LOAD&lt;BR /&gt;ProjectCount, Business_Units, Project_Status&lt;BR /&gt;resident ProjectCountbystatusbybusiness;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 04:30:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Please-Help-How-to-create-a-script-for-fact-table/m-p/253276#M1206312</guid>
      <dc:creator />
      <dc:date>2010-04-23T04:30:09Z</dc:date>
    </item>
  </channel>
</rss>

