<?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 Create Data model in QV cript in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-Data-model-in-QV-cript/m-p/813122#M286880</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 have&amp;nbsp; a stored procedure( SP), I had create dQVDs of the table. and the joins&lt;/P&gt;&lt;P&gt;can anyone help me in implimenting the rest of the logic&amp;nbsp; in QV data model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[sample SP]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alter Procedure[dbo.Sample]&lt;/P&gt;&lt;P&gt;(proj_no varchar (40),&lt;BR /&gt;project_name varchar (120),&lt;BR /&gt;....#..#..#&lt;BR /&gt;//-----declarinng fields---//&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;insert into #TEMP_table&lt;BR /&gt;select&lt;/P&gt;&lt;P&gt;dd.proj_no, &lt;BR /&gt;kk.xyz_name as [project_name], &lt;BR /&gt;bb.....#&lt;BR /&gt;.&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;case &lt;BR /&gt;when bb.act_start_date is null then datediff(dd, bb.start_date, bb.end_date)&lt;BR /&gt;else datediff(dd, bb.act_start_date, bb.end_date) end as [total_duration],&lt;BR /&gt;datediff(dd, bb.start_date, bb.end_date) as [remain_duration],&lt;BR /&gt;0 as [left_hrs_day],&lt;BR /&gt;0 as [left_days_next_90],&lt;BR /&gt;0 as [left_hrs_next_90 numeric],&lt;BR /&gt;isnull(bb.total_float_hr_cnt / 8, 9999) as [total_float],&lt;BR /&gt;isnull(bb.free_float_hr_cnt / 8, 9999) as [free_float]&lt;/P&gt;&lt;P&gt;from dbo.RSRC aa&lt;BR /&gt;left outer join dbo.TASK bb on aa.task_id = bb.task_id&lt;BR /&gt;left outer join dbo.ROLE cc on aa.role_id = cc.role_id&lt;BR /&gt;left outer join dbo.PROJECT dd on aa.proj_id = dd.proj_id&lt;BR /&gt;left outer join dbo.ACTIVITY ee on bb.task_id = ee.task_id&lt;BR /&gt;left outer join dbo.XYZ&amp;nbsp; ff on dd.proj_short_name = ff.projnum&lt;BR /&gt;left outer join dbo.PROJECT_1 gg on aa.proj_id = gg.proj_id&lt;BR /&gt;left outer join dbo.METADATA hh on dd.proj_short_name = hh.segment1&lt;BR /&gt;left outer join dbo.JWBS kk on dd.proj_n0 = kk.wbso_short_name&lt;BR /&gt;where aa.proj_id in&lt;BR /&gt;(&lt;BR /&gt; select a.proj_id from dbo.PROJECT a&lt;BR /&gt; left outer join dbo.PROJECT_1 b on a.proj_id = b.proj_id&lt;BR /&gt; inner join dbo.xyz c on a.proj_id = c.proj_id&lt;BR /&gt; left outer join dbo.MAS d on a.proj_short_name = d.segment1 -- inner join excludes EPS nodes&lt;BR /&gt; left outer join dbo.META e on a.proj_short_name = e.segment1&lt;BR /&gt; where a.orig_proj_id is null &lt;BR /&gt; and c.proj_node_flag = 'Y' &lt;BR /&gt; and c.status_code = 'WS_Open' &lt;BR /&gt; and (d.segment1 is not null or a.proj_short_name like ('_xyz%')) &lt;BR /&gt;)&lt;BR /&gt;and (aa.left_qty &amp;lt;&amp;gt; 0 or aa.target_qty &amp;lt;&amp;gt; 0)&lt;BR /&gt;and ee.rsrc not like 'X%'&lt;/P&gt;&lt;P&gt;and substring(dd.proj_no, 6, 4) not in ('xy1', 'xy2', 'xy3') &lt;BR /&gt;and aa.rsrc_id is null &lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"&gt;update&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"&gt;&lt;SPAN style="color: #000000;"&gt; #TEMP_table &lt;/SPAN&gt;&lt;SPAN style="color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; project_name &lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; b&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;xyz_name&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"&gt;&lt;SPAN style="color: #000000;"&gt; #TEMP_table&amp;nbsp; a&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; dbo&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;JWBS b&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"&gt;&lt;SPAN style="color: #000000;"&gt; a&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;proj_no&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; b&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;wbs_no&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt; &lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-no-proof: yes; color: #000000; font-size: 10pt; font-family: 'Courier New';"&gt;drop table #TEMP_table &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt; &lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-no-proof: yes; color: #000000; font-size: 10pt; font-family: 'Courier New';"&gt;PS: please ignohe table names and syntax error they are just for sample&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt; &lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt; &lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-no-proof: yes; color: #000000; font-size: 10pt; font-family: 'Courier New';"&gt;Thanks in advance &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-no-proof: yes; color: #000000; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Jan 2015 10:14:46 GMT</pubDate>
    <dc:creator>gizzel123</dc:creator>
    <dc:date>2015-01-03T10:14:46Z</dc:date>
    <item>
      <title>Create Data model in QV cript</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Data-model-in-QV-cript/m-p/813122#M286880</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 have&amp;nbsp; a stored procedure( SP), I had create dQVDs of the table. and the joins&lt;/P&gt;&lt;P&gt;can anyone help me in implimenting the rest of the logic&amp;nbsp; in QV data model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[sample SP]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alter Procedure[dbo.Sample]&lt;/P&gt;&lt;P&gt;(proj_no varchar (40),&lt;BR /&gt;project_name varchar (120),&lt;BR /&gt;....#..#..#&lt;BR /&gt;//-----declarinng fields---//&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;insert into #TEMP_table&lt;BR /&gt;select&lt;/P&gt;&lt;P&gt;dd.proj_no, &lt;BR /&gt;kk.xyz_name as [project_name], &lt;BR /&gt;bb.....#&lt;BR /&gt;.&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;case &lt;BR /&gt;when bb.act_start_date is null then datediff(dd, bb.start_date, bb.end_date)&lt;BR /&gt;else datediff(dd, bb.act_start_date, bb.end_date) end as [total_duration],&lt;BR /&gt;datediff(dd, bb.start_date, bb.end_date) as [remain_duration],&lt;BR /&gt;0 as [left_hrs_day],&lt;BR /&gt;0 as [left_days_next_90],&lt;BR /&gt;0 as [left_hrs_next_90 numeric],&lt;BR /&gt;isnull(bb.total_float_hr_cnt / 8, 9999) as [total_float],&lt;BR /&gt;isnull(bb.free_float_hr_cnt / 8, 9999) as [free_float]&lt;/P&gt;&lt;P&gt;from dbo.RSRC aa&lt;BR /&gt;left outer join dbo.TASK bb on aa.task_id = bb.task_id&lt;BR /&gt;left outer join dbo.ROLE cc on aa.role_id = cc.role_id&lt;BR /&gt;left outer join dbo.PROJECT dd on aa.proj_id = dd.proj_id&lt;BR /&gt;left outer join dbo.ACTIVITY ee on bb.task_id = ee.task_id&lt;BR /&gt;left outer join dbo.XYZ&amp;nbsp; ff on dd.proj_short_name = ff.projnum&lt;BR /&gt;left outer join dbo.PROJECT_1 gg on aa.proj_id = gg.proj_id&lt;BR /&gt;left outer join dbo.METADATA hh on dd.proj_short_name = hh.segment1&lt;BR /&gt;left outer join dbo.JWBS kk on dd.proj_n0 = kk.wbso_short_name&lt;BR /&gt;where aa.proj_id in&lt;BR /&gt;(&lt;BR /&gt; select a.proj_id from dbo.PROJECT a&lt;BR /&gt; left outer join dbo.PROJECT_1 b on a.proj_id = b.proj_id&lt;BR /&gt; inner join dbo.xyz c on a.proj_id = c.proj_id&lt;BR /&gt; left outer join dbo.MAS d on a.proj_short_name = d.segment1 -- inner join excludes EPS nodes&lt;BR /&gt; left outer join dbo.META e on a.proj_short_name = e.segment1&lt;BR /&gt; where a.orig_proj_id is null &lt;BR /&gt; and c.proj_node_flag = 'Y' &lt;BR /&gt; and c.status_code = 'WS_Open' &lt;BR /&gt; and (d.segment1 is not null or a.proj_short_name like ('_xyz%')) &lt;BR /&gt;)&lt;BR /&gt;and (aa.left_qty &amp;lt;&amp;gt; 0 or aa.target_qty &amp;lt;&amp;gt; 0)&lt;BR /&gt;and ee.rsrc not like 'X%'&lt;/P&gt;&lt;P&gt;and substring(dd.proj_no, 6, 4) not in ('xy1', 'xy2', 'xy3') &lt;BR /&gt;and aa.rsrc_id is null &lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"&gt;update&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"&gt;&lt;SPAN style="color: #000000;"&gt; #TEMP_table &lt;/SPAN&gt;&lt;SPAN style="color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; project_name &lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; b&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;xyz_name&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"&gt;&lt;SPAN style="color: #000000;"&gt; #TEMP_table&amp;nbsp; a&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; dbo&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;JWBS b&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"&gt;&lt;SPAN style="color: #000000;"&gt; a&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;proj_no&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; b&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;wbs_no&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt; &lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-no-proof: yes; color: #000000; font-size: 10pt; font-family: 'Courier New';"&gt;drop table #TEMP_table &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt; &lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-no-proof: yes; color: #000000; font-size: 10pt; font-family: 'Courier New';"&gt;PS: please ignohe table names and syntax error they are just for sample&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt; &lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt; &lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-no-proof: yes; color: #000000; font-size: 10pt; font-family: 'Courier New';"&gt;Thanks in advance &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-no-proof: yes; color: #000000; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 10:14:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Data-model-in-QV-cript/m-p/813122#M286880</guid>
      <dc:creator>gizzel123</dc:creator>
      <dc:date>2015-01-03T10:14:46Z</dc:date>
    </item>
  </channel>
</rss>

