on 05-31-2007 11:11 PM
Anyone have an efficient/elegant way to transform row data into columns in a BL transaction?
Start with this:
ID Date Property Result
1 01-Jan-07 First 1
1 01-Jan-07 Second 2
2 01-Jan-07 First 3
2 01-Jan-07 Second 4
Create this
ID Date First Second
1 01-Jan-07 1 2
2 01-Jan-07 3 4
What I do right now is
1) query for data
2) determine distinct properties
2) repeat on distinct properties
3) filter query data for distinct property
4) full outer join between current property and previous properties
5) Output xml after repeater completes
This works, but it is very slow.
Andrew,
Try the InterpolatedValues inline transform on the Query Template. It might get you closer to where you want to be.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just had my first exposure to XPATH efficiency via the WIKI yesterday...looks like I've got to do some studying.
Is there an XPATH for Dummies...or better yet an XPATH for Business User dummies <grin>.
As for my filter method, I use the Sort/Filter action block to filter my complete dataset based on the property the distinct value repeater is currently on.
The Joiner branch of my BL transaction contains 5 action blocks:
Filter/Sort
Column Stripper
Column Alias
Joiner
Assignment
Do you think I can make some gains by comressing this branch via XPATH?
Andrew,
A good place to start learning about XPath is w3schools.com, they have free online tutorials. Goto this site:
http://www.w3schools.com/xpath/default.asp
As far as I'm aware there is no XPath for Dummies, but you may want to try XSLT for Dummies, it touches on XPath, although I would start with w3schools first.
Andrew,
What is the underlying source of you data query? If this is a relational database query you might just simply consider creating a stored procedure and just passing it the necessary parameters to return the resultset in your desired format of:
ID Date First Second
1 01-Jan-07 1 2
2 01-Jan-07 3 4
Regards,
Jeremy Good
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
6 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.