Query to get Item revision Mismatch
Dear Guru's,
Need your help. I am looking for a queryo get those below details.
1) Need a query which should give item revisions which are not match with 2 orgs. Ex:: We have two orgs p001 & P002 and we are seeing few item revision is same for p001 & p002 and few items are not matching with p001 item revisions. Please help me to prepare a query which will give the mismatch item details along with item revisions.
--> in P001 the item revision is 0, 001, 002 & 003
--> In P002 the item revision is only 0.
i need those mismatc records where the item revision does not match with p001 to p002 item revisions.
Thanks in advance for the help.
Regards,
SSP
Hi ,
This?? This is the Sample one or other wise give me sample data scripts create & insert commands or post in SQL and PLSQL Forum
SELECT A.* FROM sampl_table A
WHERE EXISTS (
SELECT 1 FROM sampl_table B
WHERE A.item_id = B.item_id
AND ....
AND NOT EXISTS (
SELECT 2 FROM sampl_table B
WHERE A.item_id = B.item_id
AND A.SDAY = B.SDAY
AND .....
or you use Joins
Similar Messages
-
Performance of query for getting item revisions
Hi All,
The following query took several minutes in an environment with about 7,500,000 item revisions :
SELECT
MIR.INVENTORY_ITEM_ID
, MSI.CONCATENATED_SEGMENTS ITEM_NUMBER
, MIR.ORGANIZATION_ID
, MP.ORGANIZATION_CODE
FROM
MTL_ITEM_REVISIONS_VL MIR
, MTL_PARAMETERS MP
, MTL_SYSTEM_ITEMS_VL MSI
WHERE
(MIR.INVENTORY_ITEM_ID = p_Item_ID OR MSI.CONCATENATED_SEGMENTS = p_Item_Number)
AND (MIR.ORGANIZATION_ID = p_Org_ID OR MP.ORGANIZATION_CODE = p_Org_Code)
AND MP.ORGANIZATION_ID = MIR.ORGANIZATION_ID
AND MIR.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID
AND MIR.ORGANIZATION_ID = MSI.ORGANIZATION_ID ORDER BY EFFECTIVITY_DATE, REVISION DESC;
If changing this query to the following, it takes less than a second:
SELECT
MIR.INVENTORY_ITEM_ID
, MSI.CONCATENATED_SEGMENTS ITEM_NUMBER
, MIR.ORGANIZATION_ID
, MP.ORGANIZATION_CODE
FROM
MTL_ITEM_REVISIONS_VL MIR
, MTL_PARAMETERS MP
, MTL_SYSTEM_ITEMS_VL MSI
WHERE
MSI.CONCATENATED_SEGMENTS = p_Item_Number
AND MP.ORGANIZATION_CODE = p_Org_Code
AND MP.ORGANIZATION_ID = MIR.ORGANIZATION_ID
AND MIR.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID
AND MIR.ORGANIZATION_ID = MSI.ORGANIZATION_ID ORDER BY EFFECTIVITY_DATE, REVISION DESC;
Can anyone explain the extreme difference in performance between these two queries?
Thanks & Regards
CarolinThey don't look logically equivalent to me.
Here are the differences:
WHERE (MIR.INVENTORY_ITEM_ID = p_Item_ID
OR MSI.CONCATENATED_SEGMENTS = p_Item_Number)
AND (MIR.ORGANIZATION_ID = p_Org_ID
OR MP.ORGANIZATION_CODE = p_Org_Code)
vs
WHERE MSI.CONCATENATED_SEGMENTS = p_Item_Number
AND MP.ORGANIZATION_CODE = p_Org_CodeIf they aren't logically equivalent there's no point in comparing the performance. -
CAML Query to get Items based on Year and Month From Date Column
Hi All,
* As we knew that there are default columns in calendar like Stattdate,Title,Location..etc.
* I required the CAML Query to get the list items of calender of particular Month and Year,So that I can get number of items or evetns are in Calendar
Can any one help me how can I do this using caml query
SamarHi Stuart,
Thanks for your response,I had chosen 2nd option of our above mention suggestion.But when I try to fetech the data from a calendar it is showing below error .I
had checked the below code with oter lists by changing Type to text and it worked fine.Can you please help me how can I fetech for the calulated columns
Error
"One or more field
types are not installed properly. Go to the list settings page to delete these
fields. "
Code:
string year="2014";
string month="February";
SPSite mysite = SPContext.Current.Site;
SPWeb myweb = mysite.OpenWeb();
try
SPList mylist = myweb.Lists["Calendar"];
SPQuery myquery = new SPQuery();
myquery.Query = @"<Where>
<And>
<Eq>
<FieldRef Name='Year'/>
<Value Type='Calculated'>"
+ year + @"</Value>
</Eq>
<Eq>
<FieldRef Name='Month'
/>
<Value Type='Calculated'>"
+ month + @"</Value>
</Eq>
</And>
</Where>";
SPListItemCollection totaltiems = mylist.GetItems(myquery);
Label1.Text= "Total Number of Items is "+" "+totaltiems.Count.ToString();
catch (Exception ee)
Label1.Text = ee.Message;
finally
myweb.Dispose();
Calculated Columns
Samar -
Query to get items in a subinventory with a zero quantity
Once an item has a zero quantity it is no longer displayed in the material workbench. I am looking for some guidance on a query that will get me this information to include the following:
Item Description
Item Number
Subinventory
Org
UOM
QTY = 0
Any help with a query of this nature would be appreciated.Here is the query
select msi.segment1,msi.organization_id,sum(nvl(transaction_quantity,0)) from mtl_system_items_b msi,mtl_onhand_quantities moq
where moq.inventory_item_id (+) = msi.inventory_item_id
and moq.organization_id (+) = msi.organization_id
and msi.organization_id = &org_id
and exists (select 1 from mtl_material_transactions mmt
where mmt.organization_id = msi.organization_id and mmt.inventory_item_id = msi.inventory_item_id
and mmt.transaction_quantity !=0 )
group by msi.segment1,msi.organization_id,moq.subinventory_code
having sum(nvl(transaction_quantity,0)) = 0
Check the explain plan and cost before running the query
The exists clause restricts the records only to those items that had some transactions
Hope this helps
Sandeep Gandhi -
Query about getting Item cost value.
Hi all,
In SAP Business One, Items Master Data, there is a field
Price List (Standard Price,Purchase Price,Last Purchase Price......) and corresponding Prices Listed for them.
Which is the actual price of an Item or a product?
Reply Soon
Thanks in Advance
JanakiramanHi Janakiraman,
I think you have misundertand something. What do you wanth to get? If you need to have one Base Price list, and then some other price lists based on this one, you could use any of the 10, and then on the derivated price lists say they are based on the Base Price list.
But there isn´t any standard Base Price.
Perhaps if you explain what you need(your goal), we could help you better.
Regards,
Ibai Peñ -
CAML query to get itemcount from sharepoint list based on Month/Year
Hi,
I have a SharePoint list with date field. Now I wan't to get item count for each month in Fiscal Year using SP Services. Hence, need a CAML query to get item count . Any suggestions will be appreciated.
Thanks in Advance.When you have your month, you'll need to calculate the first day and last day of the month and convert them to the ISO using to ISOString.
startDate.toISOString();
endDate.toISOString();
function searchList(startDate, endDate) {
var nURL = "/_vti_bin/lists.asmx";
var soapEnv = "<?xml version=\"1.0\" encoding=\"utf-8\"?> \
<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
<soap:Body> \
<GetListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">
<listName>{YourList}</listName> \
<viewFields></viewFields> \
<query><Query><Where><And><Geq><FieldRef Name='DateField'
/><Value Type='DateTime'>" + startDate +"</Value></Geq><Leq><FieldRef Name='DateField'><Value Type='Datetime'>"+endDate+"</Leq></And></Where></Query></query> \
<queryOptions><QueryOptions><ViewAttributes Scope='Recursive'/></QueryOptions></queryOptions>
</GetListItems> \
</soap:Body> \
</soap:Envelope>";
$.ajax({
url: nURL,
beforeSend: function(xhr) {
xhr.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetListItems");
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResults,
contentType: "text/xml; charset=utf-8"
function processResults(xData, status)
var i;
result = $(xData.responseText).find("z\\:row, row");
if (result == undefined) {
result = $(xData.responseXML).find("z\\:row, row");
$(result).each(function(i, data) {
//Magic
i++;
return i;
Brandon James SharePoint Developer/Administrator -
How to get item stock from bin location with serial numbers?
Dear experts
I want to write query for getting item stock from bin location with serial numbers..
Thank you
Santosh Dhere.Hi Santosh,
Try this:
SELECT T0.[ItemCode], T5.[DistNumber], T5.[MnfSerial], T5.[LotNumber], T3.[OnHandQty]
, T1.[BinCode], T1.[WhsCode]
FROM [dbo].[OIBQ] T0
INNER JOIN [dbo].[OBIN] T1 ON T0.[BinAbs] = T1.[AbsEntry] AND T0.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OBBQ] T2 ON T0.[BinAbs] = T2.[BinAbs] AND T0.[ItemCode] = T2.[ItemCode] AND T2.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OSBQ] T3 ON T0.[BinAbs] = T3.[BinAbs] AND T0.[ItemCode] = T3.[ItemCode] AND T3.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OBTN] T4 ON T2.[SnBMDAbs] = T4.[AbsEntry] AND T2.[ItemCode] = T4.[ItemCode]
LEFT OUTER JOIN [dbo].[OSRN] T5 ON T3.[SnBMDAbs] = T5.[AbsEntry] AND T3.[ItemCode] = T5.[ItemCode]
WHERE T1.[AbsEntry] >= (0) AND (T3.[AbsEntry] IS NOT NULL)
UNION ALL
SELECT T0.[ItemCode], T5.[DistNumber], T5.[MnfSerial], T5.[LotNumber], T0.[OnHandQty]
, T1.[BinCode], T1.[WhsCode]
FROM [dbo].[OIBQ] T0
INNER JOIN [dbo].[OBIN] T1 ON T0.[BinAbs] = T1.[AbsEntry] AND T0.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OBBQ] T2 ON T0.[BinAbs] = T2.[BinAbs] AND T0.[ItemCode] = T2.[ItemCode] AND T2.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OSBQ] T3 ON T0.[BinAbs] = T3.[BinAbs] AND T0.[ItemCode] = T3.[ItemCode] AND T3.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OBTN] T4 ON T2.[SnBMDAbs] = T4.[AbsEntry] AND T2.[ItemCode] = T4.[ItemCode]
LEFT OUTER JOIN [dbo].[OSRN] T5 ON T3.[SnBMDAbs] = T5.[AbsEntry] AND T3.[ItemCode] = T5.[ItemCode]
WHERE T1.[AbsEntry] >= (0) AND (T2.[AbsEntry] IS NULL AND T3.[AbsEntry] IS NULL)
UNION ALL
SELECT T0.[ItemCode], T0.[SRNDistNumber], T0.[SRNMnfSerial], T0.[SRNLotNumber], T0.[IBQOnhandQty] - T0.[OnHandQty]
, T0.[BinCode], T0.[WhsCode]
FROM (
SELECT T0.[BinAbs], T0.[ItemCode], MAX(T0.[OnHandQty]) AS 'IBQOnhandQty', SUM(T2.[OnHandQty]) AS 'OnHandQty', N'' AS 'BTNDistNumber', N'' AS 'BTNMnfSerial'
, N'' AS 'BTNLotNumber', N'' AS 'SRNDistNumber', N'' AS 'SRNMnfSerial', N'' AS 'SRNLotNumber', MIN(T5.[AbsEntry]) AS 'AbsEntry', MIN(T1.[BinCode]) AS 'BinCode'
, 10000044 AS 'SnbType', MIN(T5.[AbsEntry]) AS 'BTNAbsEntry', MIN(T5.[AbsEntry]) AS 'SRNAbsEntry', MIN(T1.[WhsCode]) AS 'WhsCode', MIN(T1.[SL1Code]) AS 'SL1Code'
, MIN(T1.[SL2Code]) AS 'SL2Code', MIN(T1.[SL3Code]) AS 'SL3Code', MIN(T1.[SL4Code]) AS 'SL4Code', MIN(T1.[SL1Abs]) AS 'SL1Abs'
, MIN(T1.[SL2Abs]) AS 'SL2Abs', MIN(T1.[SL3Abs]) AS 'SL3Abs', MIN(T1.[SL4Abs]) AS 'SL4Abs'
FROM [dbo].[OIBQ] T0
INNER JOIN [dbo].[OBIN] T1 ON T0.[BinAbs] = T1.[AbsEntry] AND T0.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OBBQ] T2 ON T0.[BinAbs] = T2.[BinAbs] AND T0.[ItemCode] = T2.[ItemCode] AND T2.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OSBQ] T3 ON T0.[BinAbs] = T3.[BinAbs] AND T0.[ItemCode] = T3.[ItemCode] AND T3.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OBTN] T4 ON T2.[SnBMDAbs] = T4.[AbsEntry] AND T2.[ItemCode] = T4.[ItemCode]
LEFT OUTER JOIN [dbo].[OSRN] T5 ON T3.[SnBMDAbs] = T5.[AbsEntry] AND T3.[ItemCode] = T5.[ItemCode]
WHERE T1.[AbsEntry] >= (0 ) AND (T2.[AbsEntry] IS NOT NULL)
GROUP BY T0.[BinAbs], T0.[ItemCode]
UNION ALL
SELECT T0.[BinAbs], T0.[ItemCode], MAX(T0.[OnHandQty]) AS 'IBQOnhandQty', SUM(T3.[OnHandQty]) AS 'OnHandQty', N'' AS 'BTNDistNumber', N'' AS 'BTNMnfSerial'
, N'' AS 'BTNLotNumber', N'' AS 'SRNDistNumber', N'' AS 'SRNMnfSerial', N'' AS 'SRNLotNumber', MIN(T4.[AbsEntry]) AS 'AbsEntry', MIN(T1.[BinCode]) AS 'BinCode'
, 10000045 AS 'SnbType', MIN(T4.[AbsEntry]) AS 'BTNAbsEntry', MIN(T4.[AbsEntry]) AS 'SRNAbsEntry', MIN(T1.[WhsCode]) AS 'WhsCode', MIN(T1.[SL1Code]) AS 'SL1Code'
, MIN(T1.[SL2Code]) AS 'SL2Code', MIN(T1.[SL3Code]) AS 'SL3Code', MIN(T1.[SL4Code]) AS 'SL4Code', MIN(T1.[SL1Abs]) AS 'SL1Abs'
, MIN(T1.[SL2Abs]) AS 'SL2Abs', MIN(T1.[SL3Abs]) AS 'SL3Abs', MIN(T1.[SL4Abs]) AS 'SL4Abs'
FROM [dbo].[OIBQ] T0
INNER JOIN [dbo].[OBIN] T1 ON T0.[BinAbs] = T1.[AbsEntry] AND T0.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OBBQ] T2 ON T0.[BinAbs] = T2.[BinAbs] AND T0.[ItemCode] = T2.[ItemCode] AND T2.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OSBQ] T3 ON T0.[BinAbs] = T3.[BinAbs] AND T0.[ItemCode] = T3.[ItemCode] AND T3.[OnHandQty] <> 0
LEFT OUTER JOIN [dbo].[OBTN] T4 ON T2.[SnBMDAbs] = T4.[AbsEntry] AND T2.[ItemCode] = T4.[ItemCode]
LEFT OUTER JOIN [dbo].[OSRN] T5 ON T3.[SnBMDAbs] = T5.[AbsEntry] AND T3.[ItemCode] = T5.[ItemCode]
WHERE T1.[AbsEntry] >= (0 ) AND (T3.[AbsEntry] IS NOT NULL)
GROUP BY T0.[BinAbs], T0.[ItemCode]
) T0
WHERE T0.[IBQOnhandQty] > T0.[OnHandQty]
Regards,
JC. -
Query to get Inventory ITEM details
Hi All,
Can any one give me the query to get the following details of an ITEM
ITEM
Description
Onhand availability
Org_id
Item status
Pricelist name
Subinventory
Revision
Lot
UOM
Unit Price
Thanks,
Srikanth
Edited by: 925743 on Apr 16, 2012 1:03 AMuse the following query you will get max columns
select segment1 as "ITEM",description,inventory_item_status_code,a.organization_id,list_price_per_unit,lot_control_code,primary_unit_of_measure,transaction_quantity,subinventory_code,revision,revision_qty_control_code from mtl_system_items_b a,
mtl_onhand_quantities b
Regards
Raju -
Camel Query : Calender list : Get Items agains given date that must be greater than and eqaul to start date and greater less than or equal to end date ?
A Snap of Employee holiday list
Case : Anne juul Sondergaar is on leave from 05-06-2014 to 07-06-2014
I need a query to check wheither Anne juul is on leave at 06-06-2014 ????
I am using this query that return nothing
SPQueryquery =
newSPQuery();
query.Query =
@"<Where>
<And>
<And>
<Leq>
<FieldRef Name='Til' />
<Value Type='DateTime'>"
+ WorkingStartDate.ToString("yyyy-MM-dd")
+ @"</Value>
</Leq>
<Geq>
<FieldRef Name='Fra' />
<Value Type='DateTime'>"
+ WorkingStartDate.ToString("yyyy-MM-dd")
+ @"</Value>
</Geq>
</And>
<Eq>
<FieldRef Name='Medarbejdere' />
<Value Type='Lookup'>"
+ EmployeeName.Trim() +
@"</Value>
</Eq>
</And>
</Where>"
query.ViewFields =
" <FieldRef Name='ID' />";
Ahsan RanjhaHello,
Download CAML query builder from below location and use it to build your query:
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/f7b36ebc-6142-404a-8b04-9c87de272871/where-can-i-download-the-u2u-caml-query-builder-for-sharepoint-2010may-i-know-the-exact-link?forum=sharepointgeneralprevious
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
RQL Query to get the specific range of product items from product catalog.
Hi All,
I need to do the batch wise query to product catalog.
For that i have use Query builder but that is giving me repeated items, now i wanted to use RQL using rqlStatement.
Please help me in solving the issue.
Query which i have used using QueryBuilder.
RepositoryView productView = productRepo.getView("product");
QueryBuilder productBuilder = productView.getQueryBuilder();
Query productQuery = productBuilder.createUnconstrainedQuery();
RepositoryItems[] productItems = productView.executeQuery(productQuery,startIndex,endIndex);
Can anybody help me in writing RQL Query to get the specific range of product items from product catalog.Hi Shakuntala,
There is no executeQuery method defined in RqlStatement Interface, which will accept index for output result.
So As far as I know, what u are trying to achieve is not possible with RQL statements OOTB way.U can consider range of results based on some condition from Repository items.
Please let me know if u find any way to implement it.
Above Query builder should always return different ids if range is not overlapping with previous range.
Please verify that repeated items ids are same or different,
Quoting from API docs:
RepositoryItem[] executeQuery(Query pQuery,
int pStartingIndex,
int pEndingIndex)
throws RepositoryException
Executes the given query and returns an array of matching RepositoryItems, which are contained within a total potential result set. For example used if one wanted to retrieve elements 50-60 from a query which could return 100 elements.
Regards,
Nitin. -
CAML query to get Published items in javascript client object
Hi,
I am using the Javascript client object model.
I am trying to use the CAML query to fetch the Published items. (excluding checked-in but not published) .
I have tried the below code, but I am not able to get the published items alone. I am getting the checked-in but not published items as well.
function FetchPages() {
var clientcontext = new SP.ClientContext.get_current();
var oweb = clientcontext.get_web();
var olist = oweb.get_lists().getByTitle("Pages");
var query = new SP.CamlQuery();
query.ViewXml = "<Where>
<Eq><FieldRef Name=\"_Level\" /><Value Type=\"Integer\">1</Value></Eq></Where>";
query.set_viewXml();
pagesItems = olist.getItems(query);
clientcontext.load(NewsItems, 'Include(Title,FileLeafRef,FileDirRef)');
clientcontext.executeQueryAsync(Function.createDelegate(this, this.RenderHtmlOnSuccess), Function.createDelegate(this, this.RenderHtmlOnFailure));
function RenderHtmlOnSuccess() {
var enumerator = this.pagesItems.getEnumerator();
while (enumerator.moveNext()) {
var currentItem = enumerator.get_current();
I am getting items which are published as well as items which are checked-in but not published.
Update: I have tried this query, but the same result:
<FieldRef Name='_ModerationStatus' /><Value Type='ModStat'>0</Value></Eq>
How to fix this?
Also, I checked this:
http://mysharepointwork.blogspot.com/2011/03/get-published-version-of-list-item.html
for (int index = 0; index < item.Versions.Count; index++)
if (item.Versions[index].Level == SPFileLevel.Published)
// Got the Item
How to modify the above code for Javascript client object model?
ThanksHi,
Please try to modify the query statement as below and do the test again, it works in my environment:
var query = new SP.CamlQuery();
query.set_viewXml('<View><Query><Where><Eq><FieldRef Name=\'_Level\'/><Value Type=\'Integer\'>1</Value></Eq></Where></Query></View>');
pagesItems = olist.getItems(query);
Thanks
Patrick Liang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Patrick Liang
TechNet Community Support -
Not to able add sql query in the item source
Hi,
I am getting this error when i am trying to add the sql query in the item source
ORA-20505: Error in DML: p_rowid=3206911131098131, p_alt_rowid=ID, p_rowid2=, p_alt_rowid2=. ORA-01461: can bind a LONG value only for insert into a LONG column
SELECT
"UCL"
FROM
SELECT
TRUNC((
(SUM("EV FINAL" / 100) / COUNT("Object_Name") )
+
3 *
SQRT
(SUM("EV FINAL" / 100) * SUM("EV FINAL" / 100) ) / COUNT("Object_Name") -
(SUM("EV FINAL" / 100) / COUNT("Object_Name")) * (SUM("EV FINAL" / 100) / COUNT("Object_Name"))
),3) "UCL"
FROM
SELECT
Pro.Project_Name "Project Name",
POBJ.NAME "Object_Name",
TRUNC((
( ( NVL(AEV."Total Actual",0) - (NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(ID."INCOMMING_DOC",0) ) ,0 ) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(D."DESIGN",0) ), 0 ) +
NVL( (NVL( (MAX(X."Build") / 100) ,0) * NVL(B."BUILD",0) ),0 ) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(T."TESTING",0) ),0 ) +
NVL( (NVL( (MAX(X."Release") / 100),0) * NVL(R."RELEASE",0) ),0 ) ) )
DECODE(
(NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(ID."INCOMMING_DOC",0) ) ,0 ) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(D."DESIGN",0) ), 0 ) +
NVL( (NVL( (MAX(X."Build") / 100) ,0) * NVL(B."BUILD",0) ),0 ) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(T."TESTING",0) ),0 ) +
NVL( (NVL( (MAX(X."Release") / 100),0) * NVL(R."RELEASE",0) ),0 ) ),0,NULL,
(NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(ID."INCOMMING_DOC",0) ) ,0 ) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(D."DESIGN",0) ), 0 ) +
NVL( (NVL( (MAX(X."Build") / 100) ,0) * NVL(B."BUILD",0) ),0 ) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(T."TESTING",0) ),0 ) +
NVL( (NVL( (MAX(X."Release") / 100),0) * NVL(R."RELEASE",0) ),0 ) ) ) ) * 100),2)
|| '%' "EV_INITIAL",
TRUNC((
( (NVL(AEV."Total Actual",0) - ( NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(IDR."INCOMMING_DOC_REPLAN",0) ),0) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(DR."DESIGN_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Build")/100),0) * NVL(BR."BUILD_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(TR."TESTING_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Release")/100),0) * NVL(RR."RELEASE_REPLAN",0)),0) ) )
DECODE(
( NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(IDR."INCOMMING_DOC_REPLAN",0) ),0) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(DR."DESIGN_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Build")/100),0) * NVL(BR."BUILD_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(TR."TESTING_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Release")/100),0) * NVL(RR."RELEASE_REPLAN",0)),0) ) ,0,NULL,
( NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(IDR."INCOMMING_DOC_REPLAN",0) ),0) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(DR."DESIGN_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Build")/100),0) * NVL(BR."BUILD_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(TR."TESTING_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Release")/100),0) * NVL(RR."RELEASE_REPLAN",0)),0) ) ) ) * 100),2) "EV FINAL",
TRUNC(BRV."RSV",2) "Revised SV"
FROM
PROJECTS PRO,
PROJECT_OBJECTS POBJ,
INITIAL_EFFORT IE,
SCHEDULE_VARIANCES SV,
INITIAL_EFFORT_VIEW IEV,
INCOMMING_DOC ID,
DESIGN D,
BUILD B,
TESTING T,
RELEASE R,
INCOMMING_DOC_REPLAN IDR,
DESIGN_REPLAN DR,
BUILD_REPLAN BR,
TESTING_REPLAN TR,
RELEASE_REPLAN RR,
ACTUAL_EFFORT_VIEW AEV,
REPLAN_INITIAL_EFFORT_VIEW RIEV,
BSV_RSV_VIEW BRV,
SELECT
distinct
pro.project_name "Project Name",
pobj.name "Object Name",
PRO.ID "PRO_ID",
POBJ.ID "POBJ_ID",
CASE
WHEN
ts.status in ('CLOSE','CLOSED','Closed') AND
tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review') THEN
TO_CHAR('100')
WHEN
upper(ts.status) like upper('ACCEPTED') AND
tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review') THEN
TO_CHAR('75')
WHEN
ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review') THEN
TO_CHAR('50')
WHEN
POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
emp,employee_project_pairs epp
WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review')
AND PRO.ID = :p2_projects ) THEN
TO_CHAR('100')
END "Incoming-Doc",
CASE
WHEN
ts.status in ('CLOSE','CLOSED','Closed') AND
tsk.name in ('Design Review','Design - Review','TDD - Review') THEN
TO_CHAR('100')
WHEN
UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
tsk.name in ('Design Review','Design - Review','TDD - Review') THEN
TO_CHAR('75')
WHEN
ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
tsk.name in ('Design Review','Design - Review','TDD - Review')
THEN
TO_CHAR('50')
WHEN
POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
emp,employee_project_pairs epp
WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
and tsk.name in ('Design Review','Design - Review','TDD - Review')
AND PRO.ID = :p2_projects ) THEN
TO_CHAR('100')
END "Design",
CASE
WHEN
ts.status in ('CLOSE','CLOSED','Closed') AND
tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
TO_CHAR('100')
WHEN
UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
TO_CHAR('75')
WHEN
ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
TO_CHAR('50')
WHEN
POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
emp,employee_project_pairs epp
WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
and tsk.name in ('Build Review','Build - Review','Code - Review','Code')
AND PRO.ID = :p2_projects ) THEN
TO_CHAR('100')
END "Build",
CASE
WHEN
ts.status in ('CLOSE','CLOSED','Closed') AND
tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
TO_CHAR('100')
WHEN
UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
TO_CHAR('75')
WHEN
ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
TO_CHAR('50')
WHEN
POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
emp,employee_project_pairs epp
WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
and tsk.name in ('Test Result Review','Test Result - Review','UTR - Review')
AND PRO.ID = :p2_projects ) THEN
TO_CHAR('100')
END "Testing",
CASE
WHEN
ts.status in ('CLOSE','CLOSED','Closed') AND
tsk.name in ('Release-Review','Release - Verification',
'Migration & Release - Review') THEN
TO_CHAR('100')
WHEN
UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
tsk.name in ('Release-Review','Release - Verification',
'Migration & Release - Review') THEN
TO_CHAR('75')
WHEN
ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
tsk.name in ('Release-Review','Release - Verification','Migration & Release - Review') THEN
TO_CHAR('50')
WHEN
POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
emp,employee_project_pairs epp
WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
and tsk.name in ('Release-Review','Release - Verification','Migration & Release - Review' )
AND PRO.ID = :p2_projects ) THEN
TO_CHAR('100')
END "Release"
FROM
task_status ts,projects pro,project_objects pobj,task tsk
,employees emp,employee_project_pairs epp,REVIEW_ITEMS RI
WHERE
pobj.pro_id = pro.id
and pro.id = ts.pro_id
and pobj.id = ts.pro_obj_id
and tsk.id = ts.task_id
and emp.id = epp.emp_id
and epp.pro_id = pro.id
and ts.id = ri.ts_id
AND PRO.ID = :p2_projects
and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review','Design Review','Design - Review','TDD - Review',
'Build Review','Build - Review','Code - Review','Code',
'Test Result Review','Test Result - Review','UTR - Review',
'Release-Review','Release - Verification','Migration & Release - Review')
and ri.open_timestamp in
SELECT
distinct
max(ri.open_timestamp)
FROM
task_status ts,projects pro,project_objects pobj,task tsk
,employees emp,employee_project_pairs epp,REVIEW_ITEMS RI
WHERE
pobj.pro_id = pro.id
and pro.id = ts.pro_id
and pobj.id = ts.pro_obj_id
and tsk.id = ts.task_id
and emp.id = epp.emp_id
and epp.pro_id = pro.id
and ts.id = ri.ts_id
and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review','Design Review','Design - Review','TDD - Review',
'Build Review','Build - Review','Code - Review','Code',
'Test Result Review','Test Result - Review','UTR - Review',
'Release-Review','Release - Verification','Migration & Release - Review')
AND PRO.ID = :p2_projects
GROUP BY POBJ.NAME,TSK.NAME )
UNION
select
distinct
pro.project_name "Project Name",
pobj.name "Object Name",
PRO.ID "PRO_ID",
POBJ.ID "POBJ_ID",
case
when
tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review') THEN
TO_CHAR('100')
end "Incoming-Doc",
case
when
tsk.name in ('Design Review','Design - Review','TDD - Review') THEN
TO_CHAR('100')
end "Design",
case
when
tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
TO_CHAR('100')
end "Build",
case
when
tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
TO_CHAR('100')
end "Testing",
case
when
tsk.name in ('Release-Review','Release - Verification',
'Migration & Release - Review') THEN
TO_CHAR('100')
end "Release"
FROM
projects pro
,project_objects pobj
,task tsk
,skip_phase sp
,employees emp
,employee_project_pairs epp
WHERE
pobj.pro_id = pro.id
and epp.pro_id = pro.id
AND sp.tas_id = tsk.id
and pobj.id = sp.OBJ_ID
and pro.id = sp.pro_id
and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review','Design Review','Design - Review',
'TDD - Review','Build Review','Build - Review','Code - Review','Code',
'Test Result Review','Test Result - Review','UTR - Review',
'Release-Review','Release - Verification','Migration & Release - Review')
and pro.id = :p2_projects ) X
WHERE
PRO.ID = POBJ.PRO_ID AND
PRO.ID = IE.PROJECT_NAME AND
UPPER(POBJ.NAME) = UPPER(IE.OBJECT_NAME) AND
PRO.ID = SV.PROJECT_NAME AND
UPPER(POBJ.NAME) = UPPER(SV.OBJECT_NAME) AND
PRO.ID = :p2_projects
AND PRO.ID = X."PRO_ID"
AND POBJ.ID = X."POBJ_ID"(+)
AND PRO.ID = IEV."PRO_ID"
AND POBJ.ID = IEV."POBJ_ID"
AND PRO.ID = ID."PRO_ID"
AND POBJ.ID = ID."POBJ_ID"
AND PRO.ID = D."PRO_ID"
AND POBJ.ID = D."POBJ_ID"
AND PRO.ID = B."PRO_ID"
AND POBJ.ID = B."POBJ_ID"
AND PRO.ID = T."PRO_ID"
AND POBJ.ID = T."POBJ_ID"
AND PRO.ID = R."PRO_ID"
AND POBJ.ID = R."POBJ_ID"
AND PRO.ID = IDR."PRO_ID"
AND POBJ.ID = IDR."POBJ_ID"
AND PRO.ID = DR."PRO_ID"
AND POBJ.ID = DR."POBJ_ID"
AND PRO.ID = BR."PRO_ID"
AND POBJ.ID = BR."POBJ_ID"
AND PRO.ID = TR."PRO_ID"
AND POBJ.ID = TR."POBJ_ID"
AND PRO.ID = RR."PRO_ID"
AND POBJ.ID = RR."POBJ_ID"
AND PRO.ID = AEV."PRO_ID"
AND POBJ.ID = AEV."POBJ_ID"
AND PRO.ID = RIEV."PRO_ID"
AND POBJ.ID = RIEV."POBJ_ID"
AND PRO.ID = BRV."PRO_ID"
AND POBJ.ID = BRV."POBJ_ID"
group by
PRO.PROJECT_NAME,
POBJ.NAME,
SV.status,
sv.comments,
ID."INCOMMING_DOC",D."DESIGN",B."BUILD",T."TESTING",R."RELEASE",
IDR."INCOMMING_DOC_REPLAN",DR."DESIGN_REPLAN",BR."BUILD_REPLAN",TR."TESTING_REPLAN",RR."RELEASE_REPLAN",
AEV."Total Actual",IEV."Total Plan",RIEV."Total Plan",
BRV."BSV",BRV."RSV",POBJ.Complexity,POBJ.PROGRAM_TYPE,pro.id,pobj.id,BRV."Status"
wht is the mistake i am doing here please suggets
thanks
SudhirCan you just setup an Excel/Essbase retrieval to get the data you need? You can't use SQL to query Essbase; here is a blog post that talks about it:
http://timtows-hyperion-blog.blogspot.com/2008/01/why-you-cant-use-sql-to-query-essbase.html
Since I made that post, I have found out that Essbase has now been integrated into the latest version of the Oracle BI Server and, technically, you could use SQL to query the data in Essbase via the Oracle BI Server if you have the right version.
Tim Tow
Applied OLAP, Inc -
Hi,
Would you tell me about item revisions.
why do we need revisions and how can we do it
i have gone through the documentation but i did not get information on revisions.
please give me information on it.
thanks in advance,
siddamHi,
I got answer for this query.
we can implement locator,revision,lot and serial number control for our items.
A revision is a particular version of an item,bill of material or routing.
use a revision when you the form, fit or function of an item.
revisions are sorted according to ASCII rules.
we can use numbers, letters and charecters such as *,& and # to revision lables.
each revison must be greater than previous
revision.
regards,
siddam -
How to get items from a list that has more items than the List View Threshold?
I'm using SharePoints object model and I'm trying to get all or a subset of the items from a SharePoint 2010 list which has many more items than the list view threshold (20,000+) using the SPList.GetItems() method. However no matter what I do the SPQueryThrottledException
always seems to be thrown and I get no items back.
I'm sorting based on the ID field, so it is indexed. I've tried setting the RowLimit property on the SPQuery object(had no effect). I tried specifying the RowLimit in the SPQuerys ViewXml property, but that still throws a throttle exception. I tried using the
ContentIterator as defined here:http://msdn.microsoft.com/en-us/library/microsoft.office.server.utilities.contentiterator.aspx,
but that still throws the query throttle exception. I tried specifying the RowLimit parameter in the ProcessListItems functions, as suggested by the first comment here:http://tomvangaever.be/blogv2/2011/05/contentiterator-very-large-lists/,
but it still throws the query throttle exception. I tried using GetDataTable instead, still throws query throttle exception. I can't run this as admin, I can't raise the threshold limit, I can't raise the threshold limit temporarily, I can't override the lists
throttling(i.e. list.EnableThrottling = false;), and I can't override the SPQuery(query.QueryThrottleMode = SPQueryThrottleOption.Override;). Does anyone know how to get items back in this situation or has anyone succesfully beaten the query throttle exception?
Thanks.
My Query:
<OrderBy>
<FieldRef Name='ID' Ascending='TRUE' />
</OrderBy>
<Where>
<Geq><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Geq>
</Where>
My ViewXml:
<View>
<Query>
<OrderBy><FieldRef Name='ID' Ascending='TRUE' /></OrderBy>
<Where>
<Geq><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Geq>
</Where>
</Query>
<RowLimit>2000</RowLimit>
</View>
Thanks again.I was using code below to work with 700000+ items in the list.
SPWeb oWebsite = SPContext.Current.Web;
SPList oList = oWebsite.Lists["MyList"];
SPQuery oQuery = new SPQuery();
oQuery.RowLimit = 2000;
int intIndex = 1;
do
SPListItemCollection collListItems = oList.GetItems(oQuery);
foreach (SPListItem oListItem in collListItems)
//do something oListItem["Title"].ToString()
oQuery.ListItemCollectionPosition = collListItems.ListItemCollectionPosition;
intIndex++;
} while (oQuery.ListItemCollectionPosition != null);
Oleg
Hi Oleg, thanks for replying.
The problem with the code you have is that your SPQuery object's QueryThrottleMode is set to default. If you run that code as a local admin no throttle limits will be applied, but if you're not admin you will still have the normal throttle limits. In my
situation it won't be run as a local admin so the code you provided won't work. You can simulate my dilemma by setting the QuerryThrottleMode property to SPQueryThrottleOption.Strict, and I'm sure you'll start to get SPQueryThrottledException's
as well on that list of 700000+ items.
Thanks anyway though -
SQL query to get a list of relations between workitems
How can I create a SQL query to get a list of all problems with related changes? And all problems with related incidents?
I have tried to join the tables RelationshipTypeDim with ProblemDimKey and ChangeRequestDim, but the results are not correct.The relationships in the data warehouse can be kind of tricky. The relationships are contained in the WorkItemRelatesToWorkItemFactvw table. This table lists the related items by their WorkItemDimKey, so you cannot reference directly from the ChangeRequestDimvw
or ProblemDimvw. You will need to reference the WorkItemDimvw to get the WorkItemDimKey for each entry.
The query below will get all of the related work items from the Change Request class. The way the joins work is ChangeRequestDimvw gets the list of change requests. Then inner joins WorkItemDimvw to get the WorkItemDimKey for each CR. Then inner joins WorkItemRelatesToWorkItemFactvw
to get all of the CRs with related work items. Then inner joins the WorkItemDimvw again to get the ID of the related work item.
Now the tricky part is it appears that these relationship are set based on which item that created the relationship. So you need to union a second query that reverse the relationship on the WorkItemRelatesToWorkItemFactvw.
This query should give you a good start on getting the related work items. You can filter it down from here if you only want to include problems.
SELECT C.ID, WIWI.ID
FROM dbo.ChangeRequestDimvw C
INNER JOIN dbo.WorkItemDimvw WI ON
WI.EntityDimKey = C.EntityDimKey
INNER JOIN dbo.WorkItemRelatesToWorkItemFactvw AS WIRWI ON
WIRWI.WorkItemDimKey = WI.WorkItemDimKey
INNER JOIN dbo.WorkItemDimvw AS WIWI ON
WIWI.WorkItemDimKey = WIRWI.WorkItemRelatesToWorkItem_WorkItemDimKey
union
SELECT C.ID, WIWI.ID
FROM dbo.ChangeRequestDimvw C
INNER JOIN dbo.WorkItemDimvw WI ON
WI.EntityDimKey = C.EntityDimKey
INNER JOIN dbo.WorkItemRelatesToWorkItemFactvw AS WIRWI ON
WIRWI.WorkItemRelatesToWorkItem_WorkItemDimKey = WI.WorkItemDimKey
INNER JOIN dbo.WorkItemDimvw AS WIWI ON
WIWI.WorkItemDimKey = WIRWI.WorkItemDimKey
Order by C.ID
Matthew Dowst |
Blog | Twitter
Maybe you are looking for
-
Critical issue with exporting images in iPhoto 08?
I have been exporting selected photos to a thumb drive under iPhoto 06. I then take the thumb drive and put it in a pioneer palsma and go to GALLERY mode. Works fantastic and I can then review the images with my clients. Never had a problem with iPho
-
Since installing Lion, the first wake from sleep of the day has been taking longer and longer. The system tray clock said 09:31:14 when it appeared this morning but I didn't get full control of the machine, free of the wristwatch and the beachball un
-
file://localhost/Users/bogdan/Desktop/Screen%20Shot%202012-01-28%20at%2008.59.06 .png
-
Best Way To Clean iPhone Screen?
I've had my iPhone since the day it came out and, as such, it's been jostled a fair bit. I use the cleaning cloth that came with it but sometimes there are spots that it can't get off. I'm afraid of using anything wet on it, even a damp cloth. Someon
-
AppleTV2 can't stream audio to my airport express
Dear Apple Support, I just bought a brand new AppleTV2 (2nd generation) today and wanted to get my Apple setup just perfect - but AppleTV2 second generation dissapointed REALLY! You should definitely stick with AppleTV 1st generation. AppleTV2 can't