Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disply metrice based on a join

Status
Not open for further replies.

raguc

Programmer
Mar 12, 2003
1
US
Hi

We have a table called order with various columns like oid,vid,odata,etc. The other table is called prod which has columns like oid,product_type etc.

oid is the pk/fk between hes tables. I want to get a count(oid) from order table grouped by product-type.

I created an attribute with oid and prod_type code. oid was used for joining and prod-type code is the only form on display.

Somehow MSTR creates a sql grouping by the oid also. May be is is used as ID in joining these tables? please help me. I am new to MSTR. Also where can I get some doc about vmall?

Thanks
 
The Engine use the ID field as the keys to do the join.
In your case I imagine you need to do a SQL like this:
select p.prod_type, count(o.oid)
from prod p, order o
where p.oid=o.oid
group by p.prod_type

What you need to do is:
create an attribute prod_type use prod_type as id;
create an attribute oid use oid as id automatic;
create a fact on the order table (any num column) and call it something (e.g. fact1)
Update schema;
create a metric count(oid) parameter at that fact level (fact1).
create a report with prod type and the metric. That's it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top