[thelist] Compare Content in Multidimensional Array [PHP/SQL]

Bojan Tesanovic btesanovic at gmail.com
Thu Sep 27 02:30:52 CDT 2007


Hi Stefan ,
can you be more specific, it is not clear what you really want from PHP
and some terms are confusing eg

"So, the values for the country would be set to 100 based on the year
1975."  is there special logic for setting vales

Also what does "smallest_common_year"  mean ?

Here is how did I understood your problem

====
1.There is a table of countries with some data per year per country.
2. You would like to say , eg give me smallest statistical data for Afghanistan
comparing from year 1975-2000 and 1960-2000
====
or I am completely out of track.
Can you just write the problem you need to solve with more specific data sample eg

       name             2001    2002   2003   2004   2005
  -----------------------------------------------------------------
  Afghanistan            2.1      3.2   2.1     8.2   9
  Albania                9.8      7.6   4.5     2.1   12.8







Stefan Schwarzer wrote:
> Hi there,
> 
> I have some global national statistical data sets.
> 
> The table design is like this for each variable:
> 
>      name             2001    2002   2003   2004   2005
> -----------------------------------------------------------------
> Afghanistan    ....
> Albania            ....
> 
> 
> I would like to offer the possibility to compare two (or more)  
> variables for a given country. The data values need to be set to 100  
> at the first year which both variables have in common.
> 
> So, one variable could have an annual vallues between 1960 and 2005;  
> another one only from 1975 to 2005.
> 
> So, the values for the country would be set to 100 based on the year  
> 1975.
> 
> In the moment I have a loop for the number of variables, selecting  
> all data and stocking them into an array:
> 
> 
>             $data[$number_of_dataset][$year] = $value_of_that_year;
> 
> 
> Probably there could be better approach in finding the  
> "smallest_common_year"?!
> 
> If not, I wonder how, by using PHP, I can get that information...
> 
> Can anyone give me a hint?
> 
> Thank you very much!
> 
> Stef
> 
> 
>    ____________________________________________________________________
> 
>    Stefan Schwarzer
> 
>    Lean Back and Relax - Enjoy some Nature Photography: http:// 
> photoblog.la-famille-schwarzer.de
> 
>    Or: Appetite for Global Data? UNEP GEO Data Portal: http:// 
> geodata.grid.unep.ch
>    ____________________________________________________________________
> 
> 
> 


-- 
Bojan Tesanovic
http://www.classicio.com/
http://www.real-estates-sale.com/



More information about the thelist mailing list