<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://in.compucrete.com/index.php?action=history&amp;feed=atom&amp;title=DataScope_Examples</id>
	<title>DataScope Examples - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://in.compucrete.com/index.php?action=history&amp;feed=atom&amp;title=DataScope_Examples"/>
	<link rel="alternate" type="text/html" href="http://in.compucrete.com/index.php?title=DataScope_Examples&amp;action=history"/>
	<updated>2026-05-15T15:12:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>http://in.compucrete.com/index.php?title=DataScope_Examples&amp;diff=106&amp;oldid=prev</id>
		<title>WikiAdmin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://in.compucrete.com/index.php?title=DataScope_Examples&amp;diff=106&amp;oldid=prev"/>
		<updated>2023-07-14T12:58:48Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:58, 14 July 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>WikiAdmin</name></author>
	</entry>
	<entry>
		<id>http://in.compucrete.com/index.php?title=DataScope_Examples&amp;diff=105&amp;oldid=prev</id>
		<title>Intra&gt;User: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://in.compucrete.com/index.php?title=DataScope_Examples&amp;diff=105&amp;oldid=prev"/>
		<updated>2017-01-10T00:01:30Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==A/P: Expense Breakdown by Vendor==&lt;br /&gt;
Query:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
select vend_class &amp;quot;Class&amp;quot;,v.name &amp;quot;Vendor Name&amp;quot;,vend_id &amp;quot;Vend ID&amp;quot;,invoice_date &amp;quot;Invoice Date&amp;quot;,invoice_no &amp;quot;Invoice No.&amp;quot;,paid_amount &amp;quot;Amount Paid&amp;quot;,disc_taken &amp;quot;Discount Taken&amp;quot;,description &amp;quot;Description&amp;quot;,C.Description &amp;quot;Class Name&amp;quot;,invoice_date &amp;quot;Year&amp;quot;,invoice_date  &amp;quot;Month&amp;quot;,invoice_date  &amp;quot;Quarter&amp;quot;, exp_gl &amp;quot;Distribution G/L&amp;quot;,dist_amt &amp;quot;Amount&amp;quot;,a.description &amp;quot;Account Name&amp;quot;, &lt;br /&gt;
a.segment_1 &amp;quot;Acct&amp;quot;,a.segment_2 &amp;quot;Plant&amp;quot;,vend_id||':  '||v.name &amp;quot;Vendor&amp;quot;,void_flag &amp;quot;Void Flag&amp;quot;,source_flag &amp;quot;Source&amp;quot;&lt;br /&gt;
 from aptinvhd i&lt;br /&gt;
inner join aptvend v on v.vend_id=i.vend_id&lt;br /&gt;
inner join aptinvdt d on d.session_no=i.session_no and d.trans_no=i.trans_no&lt;br /&gt;
inner join aptvecls c on c.class_no=v.vend_class&lt;br /&gt;
left outer join gltacct a on a.gl_account=d.exp_gl&lt;br /&gt;
where invoice_date between  :&amp;quot;Begin Date&amp;quot; and :&amp;quot;End Date&amp;quot;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Ds ap exp by ven.png]]&lt;br /&gt;
Data Items:&lt;br /&gt;
*Amount&lt;br /&gt;
&lt;br /&gt;
Columns:&lt;br /&gt;
*Year (Grouping: Year)&lt;br /&gt;
*Month (Grouping: Month)&lt;br /&gt;
&lt;br /&gt;
Rows:&lt;br /&gt;
*Vendor&lt;br /&gt;
*Distribution G/L&lt;br /&gt;
*Description&lt;br /&gt;
&lt;br /&gt;
==Accounts Payable Open Invoice by Year/Month==&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
select v.vend_class class,v.vend_id,v.name, i.invoice_no,invoice_date,due_date,&lt;br /&gt;
due_date Month_Due,due_date Year_Due,gross_amount &amp;quot;Inv AMT&amp;quot;,(paid_amount+disc_taken) paid,gross_amount-(paid_amount+disc_taken)  balance,to_pay_amount,&lt;br /&gt;
description&lt;br /&gt;
 from aptinvhd i&lt;br /&gt;
inner join aptvend v on v.vend_id = i.vend_id&lt;br /&gt;
where gross_amount-paid_amount-disc_taken&amp;lt;&amp;gt;0&lt;br /&gt;
order by vend_class,i.due_date&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Setup:&lt;br /&gt;
*DATA: &lt;br /&gt;
:Balance&lt;br /&gt;
*COLUMN: &lt;br /&gt;
::Year_Due (Group by Year)&lt;br /&gt;
::Month_Due (Group by Month)&lt;br /&gt;
*ROW:&lt;br /&gt;
*Vend_ID&lt;br /&gt;
*Name&lt;br /&gt;
&lt;br /&gt;
[[Image:Ds ap open yr mo.png]]&lt;br /&gt;
&lt;br /&gt;
==Accounts Receivable Open Invoice by Days Out==&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
select i.*,c.name,  i.invoice_date mo, i.invoice_date YR, &lt;br /&gt;
DEBIT_AMOUNT-CREDIT_AMOUNT BALANCE,c.active_flag,&lt;br /&gt;
cast ('today' as date)-Invoice_date DaysOut&lt;br /&gt;
 from exv_aRinvoices i&lt;br /&gt;
inner join artcust c on c.cust_no=i.cust_no &lt;br /&gt;
WHERE DEBIT_AMOUNT-CREDIT_AMOUNT&amp;lt;&amp;gt;0&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Ds ar open days out.png]]&lt;br /&gt;
&lt;br /&gt;
==Sales Query with Drill Down==&lt;br /&gt;
&lt;br /&gt;
'''Main Query:'''&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
SELECT h.cust_no &amp;quot;Cust No&amp;quot;, c.name &amp;quot;Name&amp;quot;,h.job_po_loc &amp;quot;Job&amp;quot;,&lt;br /&gt;
p.product_class||': '||pc.description &amp;quot;Product Class&amp;quot;,&lt;br /&gt;
d.product_code &amp;quot;Product Code&amp;quot;,p.description_1 &amp;quot;Product Name&amp;quot;,p.base_product &amp;quot;Product Base&amp;quot;,&lt;br /&gt;
h.cust_class &amp;quot;Customer Class&amp;quot;,     &lt;br /&gt;
sum(d.qty_sold) &amp;quot;Quantity&amp;quot;, sum(d.ext_price) &amp;quot;Sales&amp;quot;, sum(d.ext_cost) &amp;quot;Cost&amp;quot;, sum(d.ext_disc) &amp;quot;Disc Offrd&amp;quot;,&lt;br /&gt;
sum(d.ext_price) &amp;quot;Avg Price&amp;quot;, sum(d.ext_price) &amp;quot;Change&amp;quot;,&lt;br /&gt;
h.invoice_date &amp;quot;Month&amp;quot;, h.invoice_date &amp;quot;Quarter&amp;quot;,Invoice_Date &amp;quot;Year&amp;quot; , &lt;br /&gt;
h.plant_no &amp;quot;Plant&amp;quot;, h.tax_authority &amp;quot;Tax Auth&amp;quot;, &lt;br /&gt;
h.salesperson &amp;quot;Sales Person&amp;quot;,d.unit_of_measure &amp;quot;UM&amp;quot; &lt;br /&gt;
  FROM artslshd h&lt;br /&gt;
  INNER JOIN artslsdt d ON (h.session_no = d.session_no) and (h.trans_no = d.trans_no)&lt;br /&gt;
  INNER JOIN artcust c on (c.cust_no = h.cust_no)&lt;br /&gt;
  inner join artprod p on p.product_code=d.product_code&lt;br /&gt;
  inner join artprcls pc on (pc.class_no=p.product_class)&lt;br /&gt;
    WHERE (d.comment_flag = 'N')&lt;br /&gt;
   and h.invoice_date between :beg_date and :end_date&lt;br /&gt;
group by &lt;br /&gt;
  h.cust_no, c.name,h.job_po_loc,&lt;br /&gt;
  p.product_class,pc.description,&lt;br /&gt;
  d.product_code,p.description_1,&lt;br /&gt;
  h.cust_class,     &lt;br /&gt;
  h.invoice_date,h.plant_no , h.tax_authority, h.salesperson ,d.unit_of_measure,p.base_product&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Drilldown Query:'''&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
SELECT h.cust_no &amp;quot;Cust No&amp;quot;, c.name &amp;quot;Name&amp;quot;,h.job_po_loc &amp;quot;Job&amp;quot;,&lt;br /&gt;
p.product_class||': '||pc.description &amp;quot;Product Class&amp;quot;,&lt;br /&gt;
d.product_code &amp;quot;Product Code&amp;quot;,p.description_1 &amp;quot;Product Name&amp;quot;,p.base_product &amp;quot;Product Base&amp;quot;,&lt;br /&gt;
h.cust_class &amp;quot;Customer Class&amp;quot;,     &lt;br /&gt;
d.qty_sold &amp;quot;Quantity&amp;quot;, d.ext_price &amp;quot;Sales&amp;quot;, d.ext_cost &amp;quot;Cost&amp;quot;, d.ext_disc &amp;quot;Disc Offrd&amp;quot;,&lt;br /&gt;
h.invoice_date &amp;quot;Month&amp;quot;,&lt;br /&gt;
h.plant_no &amp;quot;Plant&amp;quot;, h.tax_authority &amp;quot;Tax Auth&amp;quot;, &lt;br /&gt;
h.salesperson &amp;quot;Sales Person&amp;quot;,d.unit_of_measure &amp;quot;UM&amp;quot; &lt;br /&gt;
  FROM artslshd h&lt;br /&gt;
  INNER JOIN artslsdt d ON (h.session_no = d.session_no) and (h.trans_no = d.trans_no)&lt;br /&gt;
  INNER JOIN artcust c on (c.cust_no = h.cust_no)&lt;br /&gt;
  inner join artprod p on p.product_code=d.product_code&lt;br /&gt;
  inner join artprcls pc on (pc.class_no=p.product_class)&lt;br /&gt;
    WHERE &lt;br /&gt;
   h.invoice_date between :beg_date and :end_date and &lt;br /&gt;
[WHERE Cust No=h.cust_no]&lt;br /&gt;
[WHERE Job=h.job_po_loc]&lt;br /&gt;
[WHERE Product Class=p.product_class||': '||pc.description]&lt;br /&gt;
[WHERE Product Code=p.product_code]&lt;br /&gt;
[WHERE Customer Class=h.cust_class]&lt;br /&gt;
[WHERE Month=extract(month from h.invoice_date)]&lt;br /&gt;
[WHERE Quarter=(2+extract(month from h.invoice_date))/3]&lt;br /&gt;
[WHERE Year=extract(year from h.invoice_date)]&lt;br /&gt;
[WHERE Plant=h.plant_no]&lt;br /&gt;
[WHERE Tax Auth=h.tax_authority]&lt;br /&gt;
[WHERE Sales Person=h.salesperson]&lt;br /&gt;
[WHERE UM=d.unit_of_measure]&lt;br /&gt;
[WHERE Product Base=p.base_product]&lt;br /&gt;
and  (d.comment_flag = 'N')   &lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This query is very flexible.  It can be stripped down for efficiency and simplicity.&lt;br /&gt;
&lt;br /&gt;
Recomended Data Items:&lt;br /&gt;
*Sales&lt;br /&gt;
*Qty&lt;br /&gt;
*Avg Price (Summary Type: Weighted Average/Qty)&lt;br /&gt;
&lt;br /&gt;
Recomended Columns:&lt;br /&gt;
*Year (Grouping: Year)&lt;br /&gt;
*Quarter (Grouping: Year)&lt;br /&gt;
*Month (Grouping: Month)&lt;br /&gt;
&lt;br /&gt;
'''See Also: [[DataScope G/L Finanacial Statements]]'''&lt;/div&gt;</summary>
		<author><name>Intra&gt;User</name></author>
	</entry>
</feed>