Join two dataProviders
I have a chart with a secondary axis and two ArrayCollections because I want the series on the left axis to update independently from the series on the right axis. Flex charts support only one dataProvider.
How do I join two ArrayCollections to make one data provider?
This code uses two data providers, or perhaps I'm not understanding the issue (perhaps post code):
<?xml version="1.0"?>
<!-- charts/StyledMultipleAxes.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var SMITH:ArrayCollection = new ArrayCollection([
{date:"22-Aug-05", close:41.87},
{date:"23-Aug-05", close:45.74},
{date:"24-Aug-05", close:42.77},
{date:"25-Aug-05", close:48.06},
[Bindable]
public var DECKER:ArrayCollection = new ArrayCollection([
{date:"22-Aug-05", close:157.59},
{date:"23-Aug-05", close:160.3},
{date:"24-Aug-05", close:150.71},
{date:"25-Aug-05", close:156.88},
[Bindable]
public var deckerColor:Number = 0x224488;
[Bindable]
public var smithColor:Number = 0x884422;
]]></mx:Script>
<mx:Stroke id="h1Stroke"
color="{smithColor}"
weight="8"
alpha=".75"
caps="square"
/>
<mx:Stroke id="h2Stroke"
color="{deckerColor}"
weight="8"
alpha=".75"
caps="square"
/>
<mx:Panel title="Column Chart With Multiple Axes">
<mx:ColumnChart id="myChart" showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis id="h1" categoryField="date"/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderers>
<mx:AxisRenderer placement="bottom" axis="{h1}"/>
</mx:horizontalAxisRenderers>
<mx:verticalAxisRenderers>
<mx:AxisRenderer placement="left" axis="{v1}">
<mx:axisStroke>{h1Stroke}</mx:axisStroke>
</mx:AxisRenderer>
<mx:AxisRenderer placement="left" axis="{v2}">
<mx:axisStroke>{h2Stroke}</mx:axisStroke>
</mx:AxisRenderer>
</mx:verticalAxisRenderers>
<mx:series>
<mx:ColumnSeries id="cs1"
horizontalAxis="{h1}"
dataProvider="{SMITH}"
yField="close"
displayName="SMITH"
>
<mx:fill>
<mx:SolidColor color="{smithColor}"/>
</mx:fill>
<mx:verticalAxis>
<mx:LinearAxis id="v1" minimum="40" maximum="50"/>
</mx:verticalAxis>
</mx:ColumnSeries>
<mx:LineSeries id="cs2"
horizontalAxis="{h1}"
dataProvider="{DECKER}"
yField="close"
displayName="DECKER"
>
<mx:verticalAxis>
<mx:LinearAxis id="v2" minimum="150" maximum="170"/>
</mx:verticalAxis>
<mx:lineStroke>
<mx:Stroke
color="{deckerColor}"
weight="4"
alpha="1"
/>
</mx:lineStroke>
</mx:LineSeries>
</mx:series>
</mx:ColumnChart>
<mx:Legend dataProvider="{myChart}"/>
</mx:Panel>
</mx:Application>
If this post answers your question or helps, please mark it as such. Thanks!
http://www.stardustsystems.com
Adobe Flex Development and Support Services
Similar Messages
-
Option to join two dataproviders
Hi,
I hope this is sent to the right forum.
This is a question where I believe that the answer is "no - not possible" but I would really like it to be "yes it is possible".
Can anyone confirm my assumptions? Does anyone else feel this should be on a wish-list?
First some words on the setup.
I have two dataproviders. DP1 and DP2. The source data are from different universes as the datasources are on different servers.
The dataproviders have multiple non-equal dimensions, so linking the datsets is not an option. To effectively linking two datasets you must link all dimensions from one of the datasets to the other.
In some (many?) cases I think this is overly strict.
Say we build a clever universe/query so that the DP1 query has a dimension which is essentially the PK of the dataset retreived. This would require only that dimension to be linked and the rest of the data would be fine.
One option I've been considering is to make all dimensions in the universe as "details" under that "PK" of the retreived dataset. However that would mess up the dimensional hierarchy that is setup in the universe (i.e. an object is either a detail or a dimension / or you need duplicate definitions of ALL dimensions and you really need to keep track of what you're doing).
To generalize - in other setup we could have the data organized in granularity hierarchies. Assuming straight hierarchies we would only need to link the most granular detail of each such hierarchy in order to link two data providers.
/regards MatsHi,
Thank you Alex and Pizzaman for you insights into this.
I found a workaround that works. It is possible to re-define the dimensions as details in a report variable. This is only possible if that source is really unique on a key, i.e. it is a true detail.
It is a bit more work. But it will allow me to combine the results into one results report. Still, I think this should be possible to define on universe level instead.
/Mats -
Problem encountered when join two remote tables in a materialized view
I'm using oracle 9.2.0.6
1> I have two tables:
CREATE TABLE TEST
A VARCHAR2(100 BYTE),
C DATE
CREATE TABLE TEST1
A VARCHAR2(100 BYTE),
B TIMESTAMP
2>. I defined a prebuild table:
CREATE TABLE MV_TEST1
ID1 ROWID,
A VARCHAR2(100 BYTE),
ID2 ROWID,
B TIMESTAMP(6),
C DATE
3> I created mview logs:
CREATE MATERIALIZED VIEW LOG ON PSI_TEST.TEST
WITH ROWID
INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW LOG ON PSI_TEST.TEST1
WITH ROWID
INCLUDING NEW VALUES;
4> when I create mview:
CREATE MATERIALIZED VIEW PSI_TEST.MV_TEST1
ON PREBUILT TABLE WITH REDUCED PRECISION
REFRESH FAST ON DEMAND
WITH PRIMARY KEY
AS
select
test.rowid id1,
test.a,
test1.rowid id2,
test1.b,
cast(null as date) c
from test , test1
where test.a = test1.a(+);
It is created successfully.
5> problem:
when I use remote tables to do the same thing, say test and test1 are in another instance and are connected by a dbLink, I couldn't create the mview successfully:
CREATE MATERIALIZED VIEW PSI_TEST.MV_TEST1
ON PREBUILT TABLE WITH REDUCED PRECISION
REFRESH FAST ON DEMAND
WITH PRIMARY KEY
AS
select
a.rowid id1,
a.a,
b.rowid id2,
b.b,
cast(null as date) c
from test@dbl a, test1@dbl b
where a.a = b.a(+);
when run above statement, I got:
ORA-12015: cannot create a fast refresh materialized view from a complex query
Any ideas? Or joining two table through a dblink for a mview is not allowed at all?
Thanks in advance.No one has a clue?
Message was edited by:
lzhwxy -
I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
[ABCTABLE]
ABCORDER
ABCPART
ABCSERIAL
ABCDATE
[ZYXTABLE]
XYZORDER
XYZPART
XYZSERIAL
XYZDATE1
XYZDATE2Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
on this computer. There are no "Null" fields in either of the tables.
This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
[MSORDR]
MSORDER
MSPART
MSSERIAL
MSOPNDATE
11111111
4444444
55555
2/4/2015
22222222
6666666
11111
1/6/2015
33333333
6666666
11111
3/5/2015
This table has one order for every part number and every serial number.
[GLORDR]
GLORDER
GLPART
GLSERIAL
GLSTARTDATE
GLENDDATE
ABC11111
444444
55555
1/2/2015
4/4/2015
ABC22222
666666
11111
1/5/2015
4/10/2015
AAA11111
555555
22222
3/2/2015
4/10/2015
Post Query table
GLORDER
MSORDER
GLSTARTDATE
GLENDDATE
MSOPNDATE
ABC11111
11111111
1/2/2015
4/4/2015
2/4/2015
ABC22222
22222222
1/5/2015
4/10/2015
1/6/2015
ABC22222
33333333
1/5/2015
4/10/2015
3/5/2015
This is the SQL minus the between date join.
SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART); -
We have tried joining two DSO's and are getting the warning that "more than one datasource has been used in this report". It appears that the DSO driver does not support joins. The report runs but it is VERY slow, the same sort of performance you get when you try to join data from two datasources that are actually different (like two different SQL Server databases or an Oracle table joined to a SQL Server table). It appears that this is not a supported function with the DSO driver. Any thoughts?
Yes, we have created the joins between the two DSOs. We are looking into using the Open SQL driver to go against the base tables to see if that will work. This is how the original ODS driver used to work.
Update: After changing the join type to a left outer join the performance improved signficantly. Although not ideal it looks like it will be fine for our requirements. This particular report will be run monthly and scheduled to run overnight.
Edited by: Mike Garrett on Oct 27, 2009 4:28 PM -
Hi Sir/ Madam,
My name is Rishav and I am facing some problem with my Photoshop CC. Actually I have a question. If you guys could help me out i will be very obliged. The quest in "Can you please help me by saying me how can i join two different picture to make it as one picture.??"Maybe you should post over at
Photoshop for Beginners
or start with the "Get Started" section of the Help:
Photoshop Help | Photoshop Help
And your question
Can you please help me by saying me how can i join two different picture to make it as one picture.??
does not seem particularly specific – do you want to simply combine two images as they are, do you want to clip elements from the one and insert them into the other, …?
Could you post (lores of) the images and explain what you intend to achieve? -
Using a view to join two tables
Thank you in advance for any advice you can lend.
I am using this code in my MySQL db to create a view.
select
job.id as job_id,
umr_cost_calculation.plant_name,
max(umr_cost_calculation.id) as max_id
from
job,
umr_cost_calculation
where
job.id = umr_cost_calculation.job_id
group by job.id , umr_cost_calculation.plant_name
I did this so I can join two tables and pull in the most current cost data for a specific plant. The report will, at times, show the wrong (older) data. I can re-run the report, filter to just the one job and see again the wrong data. When I add the max_id to the report, it display the id and updates the report with the correct data. It appears that the view was stale and by adding the ID to the report this fixed the issue.
1) Is this the best way to make this join? I don't see how Crystal supports a subquery to make a join (this is why I used the view).
2) If I leave the max_id on the report, will this force the view to always update?Try:
Select
D1.EmpLoginID,
Count(D1.ID),
Count(D1.AlarmCode),
D1.EmpName,
D1.EmpAddress,
D2.Db2Count
FROM DB1.Data D1
LEFT JOIN (SELECT
empLoginID, Count(*) as Db2Count
FROM DB2.ALL_Database
WHERE site = 'Atlanta'
GROUP BY empLoginID
) D2
ON D1.EmpLoginID = D2.EmpLoginID
GROUP BY D1.empLoginID, D1.EmpName, D2.EmpAddress, D2.Db2Count
Order BY D1.empLoginID ASC
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
DataType conflict in the R/3 when joining two tables
Hi Experts,
I have created a view with two table in the R/3 side by joining two common fields,but one of the field is getting error with different data type, so could any one suggest me how to resolve this issue without changing type.
Thanks,
VenugopalHi
Actually I have to pull one of the field from one table and place in other table and create a generic data source on it,Can any one suggest me with any solution or exists to solve this issue.
Thanks,
Venugopal -
How do you join two tables from different Oracle schemas using a subquery
I am trying to join two tables from different Oracle schemas using a subquery. I can extract data from each of the tables without a problem. However, when I combine the select statements using a subquery I get the Oracle error *'ORA-00936: missing expression'*. Since each SELECT statement executes on its own without error I don't understand what is missing. The result set I am trying to get is to match up the LINE_ID from PDTABLE_12_1 in schema DD_12809 with the MAT_DESCRIPTION from table PDTABLE_201 in schema RA_12809.
The query is as follows:
sql = "SELECT [DD_12809].[PDTABLE_12_1].LINE_ID FROM [DD_12809].[PDTABLE_12_1] JOIN " _
+ "(SELECT [RA_12809].[PDTABLE_201].MAT_DESCRIPTION " _
+ "FROM [RA_12809].[PDTABLE_201]) AS FAB " _
+ "ON [DD_12809].[PDTABLE_12_1].PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS"
The format of the query is copied from a SQL programming manual.
I also tried executing the query using a straight JOIN on the two tables but got the same results. Any insight would be helpful. Thanks!
Edited by: user11338343 on Oct 19, 2009 6:55 AMI believe you are receiving the error because you are trying to JOIN on a column that doesn't exist. For example you are trying to join on FAB.PIPING_MATER_CLASS but that column does not exist in the subquery.
If you want to do a straight join without a subquery you could do the following
SELECT DD_12809.PDTABLE_12_1.LINE_ID
, FAB.MAT_DESCRIPTION
FROM DD_12809.PDTABLE_12_1
JOIN RA_12809.PDTABLE_201 AS FAB ON DD_12809.PDTABLE_12_1.PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS HTH! -
Join two list with condition using caml query in SharePoint 2013 with client object model
Hi,
Want to join two list to get all fields from both list.
Am new to sharepoint and sharepoint 2013. Am working in sharepoint 2013 online apps. Am using context.executeQueryasync to load list and get items from list. Am able to get items from single list with caml query, but not able to get both list field values
with joins. I did lot of surfing..but not..
Below is my code..
ListName1 : "AssignedTasks"
ListName2 : "Tasks"
var assignedQueryTest = "<View><Joins><Join Type='INNER' ListAlias='Tasks'><Eq><FieldRef Name='TaskId' RefType='Id'/><FieldRef List='Tasks' Name='ID' /></Eq></Join></Joins>"
+ "<ViewFields><FieldRef Name='TitleValue' /><FieldRef Name='ActionItemsValue' /></ViewFields>"
+ "<ProjectedFields>"
+ "<Field Name='TitleValue' Type='Lookup' List='Tasks' ShowField='Title' /><Field Name='ActionItemsValue' Type='Lookup' List='Tasks' ShowField='ActionItems' />"
+ "</ProjectedFields>"
+ "</View>";
var web = context.get_web();
var list = web.get_lists().getByTitle("AssingedTasks");
var myQuery = new SP.CamlQuery();
myQuery.set_viewXml(assignedQueryTest);
var myItems = list.getItems(myQuery, "Include(TitleValue,ActionItemsValue)");
context.load(myItems);
context.executeQueryAsync(function () { if(myItems.get_count()>0){....}
}, errorCallback);
Here am able to get "AssignedTasks" list field values but not able to get "Tasks" list field values.
Can you please help me to resolve the issue. Or new idea for join. I have add the condition also in the query.
If anybody have good sample, please provide.
Thanks,
Pariventhan
Pariventhan.SHi Pariventhan,
I don't know about join but I have a workaround of this problem.
Declare one variable (itemcollection) globally. Load all the items "AssignedTasks" using context.load.
In the success method call another CAML query using <IN> tag of the ID of the items from the second list (Assuming you have look-up column of the ID of the first list to the second list).
If this is not clear to you then please let me know. If possible then I can provide code sample.
Thanks,
Aniruddha -
Joining two fact tables with different dimensions into single logical table
Hi Gurus,
I try to accomplish in Oracle Business Intelligence 11.1.1.3.0:
F1 (D1, D2 and D3)
F2 (D1 and D2 and D4)
And we want to build a report F1 F2 D1 D2 D3 D4 to have data for:
F1 that match only for D1-D2-D3
and data for
F2 that match only D1-D2-D4
all that in one row, so D3 and D4 are not common dimensions.
I can only do:
F3 (D1, D2)
F4 (D1, D2 and D4)
And report
F3 F4 D1,D2,D4 (all that in one row, and only D4 is not a common dimension)
Here is the very good example how to accomplish the scenario 1
http://108obiee.blogspot.com/2009/08/joining-two-fact-tables-with-different.html
But looks like it does not work in 11.1.1.3.0
I get
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 14025] No fact table exists at the requested level of detail: [,,Clients,,Day,ROI,,,,EW_Names,,,,,,,,,,,,,,,,,]. (HY000)
I am sure I set up everything correctly as advised in the blog but it works with only one not a common dimension
Is it a bug in 11.1.1.3.0 or something?
Thanks,
KateThanks for all your replies.
Actually, I've tried the solutions you guys mentioned. Generally speaking, the result should be displayed. However, my scenario is a little bit tricky.
table Y's figures are not the aggregation of table X for D dimension. Instead, table Y's figures include not only D dimension total, but also others (others do not mean A, B, C dimension). For example, table Y stores all food's figure, while table X stores only drink's figure. D dimension is only about drink's detail. In my scenario, other foods' figure is not provided.
So, even if I set D dimension to all/total for table X, table X's result is still not the same as table Y.
Indeed, table Y does not have a column key to join to D dimension's key. So, if I select D dimension and table Y's measures at the same time in BI Answer, result returns no data. Hence, I can't compare table X and table Y's results with selection of D dimension.
Is there any solution to solve this problem?
Edited by: TomChan on Jun 3, 2009 9:36 AM -
Join two source tables and replicat into a target table with BLOB
Hi,
I am working on an integration to source transaction data from legacy application to ESB using GG.
What I need to do is join two source tables (to de-normalize the area_id) to form the transaction detail, then transform by concatenate the transaction detail fields into a value only CSV, replicate it on the target ESB IN_DATA table's BLOB content field.
Based on what I had researched, lookup by join two source tables require SQLEXEC, which doesn't support BLOB.
What alternatives are there and what GG recommend in such use case?
Any helpful advice is much appreciated.
thanks,
XiaocunXiaocun,
Not sure what you're data looks like but it's possible the the comma separated value (CSV) requirement may be solved by something like this in your MAP statement:
colmap (usedefaults,
my_blob = @STRCAT (col02, ",", col03, ",", col04)
Since this is not 1:1 you'll be using a sourcedefs file, which is nice because it will do the datatype conversion for you under the covers (also a nice trick when migrating long raws to blobs). So col02 can be varchar2, col03 a number, and col04 a clob and they'll convert in real-time.
Mapping two tables to one is simple enough with two MAP statements, the harder challenge is joining operations from separate transactions because OGG is operation based and doesn't work on aggregates. It's possible you could end up using a combination of built in parameters and funcations with SQLEXEC and SQL/PL/SQL for more complicated scenarios, all depending on the design of the target table. But you have several scenarios to address.
For example, is the target table really a history table or are you actually going to delete from it? If just the child is deleted but you don't want to delete the whole row yet, you may want to use NOCOMPRESSDELETES & UPDATEDELETES and COLMAP a new flag column to denote it was deleted. It's likely that the insert on the child may really mean an update to the target (see UPDATEINSERTS).
If you need to update the LOB by appending or prepending new data then that's going to require some custom work, staging tables and a looping script, or a user exit.
Some parameters you may want to become familiar with if not already:
COLS | COLSEXCEPT
COLMAP
OVERRIDEDUPS
INSERTDELETES
INSERTMISSINGUPDATES
INSERTUPDATES
GETDELETES | IGNOREDELETES
GETINSERTS | IGNOREINSERTS
GETUPDATES | IGNOREUPDATES
Good luck,
-joe -
In OBI 11g, I have a report in which I show
dimRecord1 FactRecord
dim Record2 FactRecord2.
Is ther any way to construct a rpeot such that , it can be shown as
dimRecord1 FactRecordd dim Record2 FactRecord2.
in the same row
?Hi,
Kindly refer below link
http://108obiee.blogspot.com/2009/08/joining-two-fact-tables-with-different.html
Two Fact tables with Different set of Dimension Tables
Thanks
Deva -
HT204053 How do I join two Apple ID purchases into One?
How do I join two Apple ID purchases into One?
You can't, accounts can't be merged nor content transferred from one account to another account - content will remain tied to the account that downloaded it.
-
Hi,
I have a query that joins two tables in the same database, the result needs to be loaded in a destination DB table. How do I do this in SSIS package?
thank you !
Thank You Warmest Fanny PiedPlease take a look at these links related to your query.
http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers
http://stackoverflow.com/questions/7037228/joining-two-tables-together-in-one-database
Maybe you are looking for
-
My problem with downloading ae cs5.5
every time i try to download AE cs5.5 trial the adobe download assistant says error please try again and it still doesn't work
-
All, I have a 2 system BI landscape with BW Development and BW production. Both the systems are dual stacks. The BW production is on its standalone oracle database but the BW Development is a part of an MCOD. Now i want to refresh the BW development
-
Other Objects( Workflow Objects) in SPAU
Dear All We are going for Upgrade from 4.7 to ECC 6.0 . In that under Without Modification Assistant Node , there are OTHER OBJECTS Category. In that , all are in red traffic light and those are Workflow Objects like following. PDTS 00007842 PDTS 012
-
"Standard 3D module is missing" during startup
Can someone help me? I was going to start after effects like usual, but this dialog box: appeared, this is the first time i get that dialog box, so i freaked out. I press the 'OK' button then this: appeared! I don't see this in ALL forums, threads, a
-
Hi, What I am trying to do is simple I believe: I want a query to execute if the userid on my form is not null.. so here is a skeleton of the code if p_session.get_attribute_as_varchar2 ( ......,p_attribute=>'A_USER_ID'...) is null then htp.p('<scrip