LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-21-2013, 10:27 AM   #1
Bunty2013
LQ Newbie
 
Registered: Oct 2013
Posts: 9

Rep: Reputation: Disabled
Display the percentage of increase in data size for each month


I used to fetch monthly data from the database of table size and display in the below tabular form.

Table Name Jan-13 Feb-13 Mar-13---Nov-13 Dec-13
user_ 10MB 12MB 14 MB 15 MB 16.5 MB

This is use to handle at database level.

What help i want now is that, I wanted to display the percentage of increase in data size for each month by comparing the previous month.Here the example:

Table Name 13-Jan 13-Feb 13-Mar ----13-Nov 13-Dec YTD
user_ 10MB 12MB(20%) 14 MB(20%) 15 MB 16.5MB(10%) 65%


Here the Feb-13 is to being compared with Jan-13 and the percentage is to be taken out.The same for remember months as well.And at last I need the cumulative increase through out the year.

Is it possible at linux level, can we design the output as above? If yes, please help.
 
Old 10-21-2013, 11:26 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by Bunty2013 View Post
Table Name Jan-13 Feb-13 Mar-13---Nov-13 Dec-13
user_ 10MB 12MB 14 MB 15 MB 16.5 MB

Table Name 13-Jan 13-Feb 13-Mar ----13-Nov 13-Dec YTD
user_ 10MB 12MB(20%) 14 MB(20%) 15 MB 16.5MB(10%) 65%
Your input and output examples are inconsistent: Some entries have the amount and MB connected, some don't. If the input actually looks like that should the output copy that behaviour (last field in your example doesn't).

Please post relevant(!!) input and output examples and please put them between [code] ... [/code] tags to preserve multiple spaces/tabs and layout.

Also a question: Will the input switch to KB/GB when the size changes below 1 MB or above 1024 MB?

Last edited by druuna; 10-21-2013 at 11:55 AM. Reason: Fixed sentence
 
Old 10-21-2013, 01:21 PM   #3
Bunty2013
LQ Newbie
 
Registered: Oct 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Yah it will change to KB,MB,bytes,GB also
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Disk partitions where size is specified as percentage of remaining cylinders. cafemondegar Linux - Hardware 4 01-14-2012 05:36 PM
listing file size by percentage? abolishtheun Linux - Software 12 03-26-2008 07:22 AM
how to increase the size of a partition with data on it hlenderk Linux - General 5 02-24-2008 02:16 PM
Increase icon size in gnome for high resolution display neville310 Linux - Desktop 1 01-13-2007 09:47 AM
anyone know how to increase the display size of ur icons? mr_coffee Mandriva 4 01-22-2006 08:16 PM


All times are GMT -5. The time now is 04:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration