Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Percentage
portosr
Hi all
I have a question simple but ....I am not able to solve it.
I have a table like the following:
Col1 Col2
Hall, 39650
area1, 2784
area2, 5834
In a chart I would like to plot not the value of Col2 but the percentage then this value:
Col1 Col2 (%)
Hall, (39650-2784-5834)/39650 x 100
area1, 2784/39650 x 100
area2, 5834/39650 x 100
Any suggestion?
Many thank
portos
Find more posts tagged with
Comments
Hans_vd
How are these records related?
It seems like the Hall record is some kind of parent record, and the area1 and area2 records are some kind of child tables, is that right?
So how can be determined that a record is a parent or a child?
And how can be determined to what parent record a child belongs?
portosr
<blockquote class='ipsBlockquote' data-author="'Hans_vd'" data-cid="79563" data-time="1309815520" data-date="04 July 2011 - 02:38 PM"><p>
How are these records related?<br />
It seems like the Hall record is some kind of parent record, and the area1 and area2 records are some kind of child tables, is that right?<br />
So how can be determined that a record is a parent or a child?<br />
And how can be determined to what parent record a child belongs?<br /></p></blockquote>
<br />
There is a table in the DB that specifies if some area belongs to an Hall but I don't think that is important.
Hans_vd
The calculation of the percentage of a parent record differs from the calculation of a child record. So in order to be able to do the right calculation one needs to know when a record is a parent record and when it is a child record. Even more: one also needs to know what child records belong to what parent record as you need all the child col2 data in the calculation of the parent percentage.
So I do think it's important.
Regards
Hans
portosr
<blockquote class='ipsBlockquote' data-author="'Hans_vd'" data-cid="79580" data-time="1309852882" data-date="05 July 2011 - 01:01 AM"><p>
The calculation of the percentage of a parent record differs from the calculation of a child record. So in order to be able to do the right calculation one needs to know when a record is a parent record and when it is a child record. Even more: one also needs to know what child records belong to what parent record as you need all the child col2 data in the calculation of the parent percentage.<br />
<br />
So I do think it's important.<br />
<br />
Regards<br />
Hans<br /></p></blockquote>
Hi thank for your reply. <br />
I meant that in the table I proposed this kind of connection (between parent and child) has been already done so all the "Areaxx" in the table belong to HallID and then the percentage have to be calcultated inside the same table with the formula I wrote.<br />
Is there a solution for this kind of problem?
Hans_vd
What database are you on?
portosr
The DB is MySQL, I import the table as data set and the table I described is a data set.