Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 14th, 2003, 09:35 PM
bakerboy_1111 bakerboy_1111 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 14 bakerboy_1111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile designing report, create tree diagram

Hello all,

I'm not sure whether this is a query, form or report problem but I try my best to explain...

I'm trying to design a database that stores info on a power plant grid. Basically, the grid is made up of levels. Every level connects to a higher level (except of course the very top!). The lower levels cascade down in a tree diagram pattern, that is, any level can have multiple lower connections, but only one upper connection.

In my table, I have a column called "Upstream Feed" which gives the name of the level that is connected directly above.

My logic is, that as long as I have the name of the upstream feed of each level, then I will know the exact layout of the 'tree diagram' grid (provided I also know the very top level).

My main problem is that I wish to sum the total power at each node of the network, and add it up until the very top level. I wish to create a report that shows the power at each level, as well as the above feed, and possibly the path to the top.

I have absolutely no idea how to set this out so that it can work. I been working on this for weeks but no luck.

I guess I'm just looking for some advice as to how to design this kind of database.

Thankyou to anyone who responds,

Cheers,

Bakerboy

Reply With Quote
  #2  
Old December 15th, 2003, 10:07 AM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 281 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 16 m 17 sec
Reputation Power: 7
The problem you have defined is some what similar to Bill of Material explosion where in the same table will have parent child relation and its associated quantity per assembly in any ERP or MRP package. The table structure will look some what like this.

ParentGrid -primarykey
ChildGrid - primarykey
relatedcost

if you have a temporary table with the same structure and primary key and start the initial data in temporary table as parentgrid, parentgrid, 1 and run the following query until no more record is added to the temporary table (this can be achieved by record count before and after append) you will get all the related tree data into temporary table.
pseudo code->
Insert into temptable parentgrid, childgrid, related cost
from select parent - sorry I am not able to recollect the SQL
---- just put the temptable and yourmaintable in design window and join temptable childgrid field to maintable parentgrid field and select all fields from maintable and append it to temptable. Run this query in a loop until nomore record is added and then from temp table you can sum up the data you want.

If you need further assistance I will come with moredetailed explanation tomorrow. In the mean time pl provide a sample data if possible.
__________________
V.Subramanian

Reply With Quote
  #3  
Old December 15th, 2003, 07:22 PM
bakerboy_1111 bakerboy_1111 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 14 bakerboy_1111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks heaps for your reply supersubra.

I don't completely understand everything you wrote, but I really appreciate the response.

I'm not too sure what you mean with regards to the temporary table, but I hope I will soon! :-)

You asked for me to supply sample data, so I've attached the database file I'm working on. Also attached is a diagram showing the actual layout (just an example) that I would like the database to represent. In the diagram, I've incuded some sample power values for each level, and I've summed them to the top. In the table in the database, I've written the total power levels for each level, as well as the summed values to the top. The ultimate outcome is to have these sum automatically to the top, however due to the fact that this database is in such early stages, then I've just added them manually for now.

One more thing I've just decided to attach is a notepad text file just showing the very basic layout of the report I am hoping to create. I thought it might be useful.

Thanks again for your reply, I hope I've attached the right things you've asked for!

Bakerboy
Attached Files
File Type: zip powerflow.zip (10.0 KB, 465 views)

Reply With Quote
  #4  
Old December 16th, 2003, 12:01 PM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 281 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 16 m 17 sec
Reputation Power: 7
I have included the solution and its explanation in the attached zip file. Just try it and reply. Bye
Attached Files
File Type: zip modified.zip (54.5 KB, 508 views)

Reply With Quote
  #5  
Old December 16th, 2003, 08:11 PM
bakerboy_1111 bakerboy_1111 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 14 bakerboy_1111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks again,

That seems to be what I was talking about, though I'm still looking through it all to completely understand it!

Just one question. Is there any way that all the reports (i.e. the MSB1, MSB2 and SB1 reports) can be compiled into a single report? That is, rather than selecting the upstream feed, have all the information that is contained in the three individual reports, appear on just one?

Another question is, how hard would this design be to extend to more levels? If for instance, I want to connect something to the bottom of load 1, can this be done just by entering new data with an upstream feed of Load 1? I tried adding a load with upstream feed Load 1, but there was no option in the form to select Load 1.

Reply With Quote
  #6  
Old December 17th, 2003, 09:21 AM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 281 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 16 m 17 sec
Reputation Power: 7
I have split the table into two as load master and load info.In loadmaster any feed having child is classified as upstream and feed having direct power info as downstream. I have added a sample substation2 to show the extensibility of the data without any change in program. You can extend the loadinfo table as you please and check the value of consumption of tree at anylevel.
I will come tomorrow if u need any classification.
Attached Files
File Type: zip powerflow171203.zip (49.4 KB, 468 views)

Reply With Quote
  #7  
Old December 17th, 2003, 11:44 PM
bakerboy_1111 bakerboy_1111 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 14 bakerboy_1111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile

Thanks again supersubra :-)

The database is becoming almost exactly what I require!!

One question I have is about query 3. In this there is the expression Expr 1. The actual expression is 'MSB1'. Is there any way rather than having the name always be MSB1, be able to call it from say the upstream feed list or something? That way if I change the names in the table down the track, it won't keep writing MSB1.

Also another question (I hope I'm not sounding picky, I really do appreciate all the help you've given me, but I'm just trying to modify it to do what I require). The report shows the level, upstream feed number, upstream feed description, tag number, description and power. Is there any way that the report can show only the directly attached levels and loads?

for example,

for MSB1, have this:
(I'm using underscores because the spaces don't work once I post)

MSB1

L1____________Load 1_________________2
MSB2__________Main Switchboard 2_______9
SB1___________Substation 1____________10

__________________________Total ______21

Rather than show all the individual loads connected to MSB2, SB1 as well as the loads connected to MSB1. This is just because eventually I will add many loads to this layout, and I only wish to write the details of these once, not for every path to the top (if that makes sense).

Let me just reinforce, I am extremely grateful for all this help. I hope I'm not complaining too much, I'm just trying to explain myself thats all.

Thanks again!!

Bakerboy

Last edited by bakerboy_1111 : December 17th, 2003 at 11:47 PM.

Reply With Quote
  #8  
Old December 18th, 2003, 10:54 AM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 281 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 16 m 17 sec
Reputation Power: 7
I am not using query3 and query2 within the program. Those are queries I used to get the SQL portion which is used inside the module. Both can be deleted. Yes It is possible to get the single level or fulldrilldown or bottom most only in the report for any top level feed. I will come with a better explanation and a modified realtreeviewreport pattern later. Possibly on sunday. Till then meddle as you please. Bye.

Reply With Quote
  #9  
Old December 18th, 2003, 08:05 PM
bakerboy_1111 bakerboy_1111 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 14 bakerboy_1111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Another thing I'm noticing is that if I select all on the form, then the report shows the right info. But if I select MSB1, or SB1 or whatever, then the same info comes up each time (it seems to be showing the MSB1 info but with a SB1 or SB2 etc heading).

So basically there is no difference between selecting MSB1, MSB2, SB1,....etc. I don't understand why this is happening...

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > designing report, create tree diagram


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek