Dhope
asked on
XPath predicate / sql join-esque statement
Hi,
I have two SharePoint lists. One is a list of Purchase Requests, the other is a list of workflow tasks. A workflow task references a Purchase Request.
Occasionally a workflow will fail to start correctly and the Purchase Request gets stuck as Pending despite having no active tasks.
Using SharePoint Designer I'd like to produce a table that displays Purchase Requests currently pending in the first column and the number of active workflow tasks corresponding to that invoice in the second column.
So the left column is
@PR_x0020_Reference
from the set
/dsQueryResponse/Purchase_ Requests/R ows/Row[no rmalize-sp ace(@PR_x0 020_Status ) = 'Pending']
To count the number of tasks for a specific invoice, say ISD0000140, you use the following expression
count(../../../Workflow_Ta sks/Rows/R ow[@TaskSt atus!= 'Completed' and contains(@WorkflowLink, 'ISD0000140')])
Essentially I want to replace 'ISD0000140' with @PR_x0020_Reference, but when I do then it always evaluates to true so it just returns the total number of active tasks.
Hope that makes sense, any pointers much appreciated.
I have two SharePoint lists. One is a list of Purchase Requests, the other is a list of workflow tasks. A workflow task references a Purchase Request.
Occasionally a workflow will fail to start correctly and the Purchase Request gets stuck as Pending despite having no active tasks.
Using SharePoint Designer I'd like to produce a table that displays Purchase Requests currently pending in the first column and the number of active workflow tasks corresponding to that invoice in the second column.
So the left column is
@PR_x0020_Reference
from the set
/dsQueryResponse/Purchase_
To count the number of tasks for a specific invoice, say ISD0000140, you use the following expression
count(../../../Workflow_Ta
Essentially I want to replace 'ISD0000140' with @PR_x0020_Reference, but when I do then it always evaluates to true so it just returns the total number of active tasks.
Hope that makes sense, any pointers much appreciated.
Are you using a DVWP?
ASKER
Yes, I can add it as a joined subview but ideally I'd like to filter on the result, and the main table wouldn't know the contents of the subview that way.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Would the parameter not exist for the page rather than just a row though? (see 'code' below)
So in the first row the parameter would be PR00000010, second row would be PR00000015 etc.
So in the first row the parameter would be PR00000010, second row would be PR00000015 etc.
Column 1 | Column 2
---------------------------------------------------------
PR00000010 | count(tasks WHERE linked_item = PR00000010)
|
PR00000015 | count(tasks WHERE linked_item = PR00000015)
|
PR00000025 | count(tasks WHERE linked_item = PR00000025)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm not using Marc's crosslist dvwp. The problem isn't displaying results, it's displaying results without creating a nested table.
In the attached picture see the faint box around each result in the remaining GBP column. This is because it's a subview. I can't sort on subviews though, since each subview is unrelated to the other.
In the attached picture see the faint box around each result in the remaining GBP column. This is because it's a subview. I can't sort on subviews though, since each subview is unrelated to the other.
ASKER
I'm not using Marc's crosslist dvwp. The problem isn't displaying results, it's displaying results without creating a nested table.
In the attached picture see the faint box around each result in the remaining GBP column. This is because it's a subview. I can't sort on subviews though, since each subview is unrelated to the other.
In the attached picture see the faint box around each result in the remaining GBP column. This is because it's a subview. I can't sort on subviews though, since each subview is unrelated to the other.
ASKER
Sorry. Can't seem to upload the pic, guess the firewall at work is being a bit overzealous today.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.