Hi,
I want to find N similar items based on 2 or more columns. In the example below I am trying to find similar items based on 3 columns.
I would like to add more rows and more columns and also to determine the spann of which the items are similar.
For population = 2500, for number of pets = 100 and for number of traffic lights = 20.
If I select City1 similar items would be City2, City10.
I want to find N similar items based on 2 or more columns. In the example below I am trying to find similar items based on 3 columns.
Code:
[TABLE="width: 508"]
<tbody>[TR]
[TD]City[/TD]
[TD] Population[/TD]
[TD] Number of pets[/TD]
[TD] Number of traffic lights[/TD]
[/TR]
[TR]
[TD]City1[/TD]
[TD="align: right"]10561[/TD]
[TD="align: right"]466[/TD]
[TD="align: right"]121[/TD]
[/TR]
[TR]
[TD]City2[/TD]
[TD="align: right"]10444[/TD]
[TD="align: right"]498[/TD]
[TD="align: right"]101[/TD]
[/TR]
[TR]
[TD]City3[/TD]
[TD="align: right"]928[/TD]
[TD="align: right"]280[/TD]
[TD="align: right"]61[/TD]
[/TR]
[TR]
[TD]City4[/TD]
[TD="align: right"]13175[/TD]
[TD="align: right"]103[/TD]
[TD="align: right"]139[/TD]
[/TR]
[TR]
[TD]City5[/TD]
[TD="align: right"]4858[/TD]
[TD="align: right"]45[/TD]
[TD="align: right"]143[/TD]
[/TR]
[TR]
[TD]City6[/TD]
[TD="align: right"]13607[/TD]
[TD="align: right"]451[/TD]
[TD="align: right"]59[/TD]
[/TR]
[TR]
[TD]City7[/TD]
[TD="align: right"]1357[/TD]
[TD="align: right"]321[/TD]
[TD="align: right"]80[/TD]
[/TR]
[TR]
[TD]City8[/TD]
[TD="align: right"]3116[/TD]
[TD="align: right"]249[/TD]
[TD="align: right"]123[/TD]
[/TR]
[TR]
[TD]City9[/TD]
[TD="align: right"]9330[/TD]
[TD="align: right"]450[/TD]
[TD="align: right"]79[/TD]
[/TR]
[TR]
[TD]City10[/TD]
[TD="align: right"]11523[/TD]
[TD="align: right"]441[/TD]
[TD="align: right"]129[/TD]
[/TR]
[TR]
[TD]City11[/TD]
[TD="align: right"]6475[/TD]
[TD="align: right"]431[/TD]
[TD="align: right"]128[/TD]
[/TR]
[TR]
[TD]City12[/TD]
[TD="align: right"]8793[/TD]
[TD="align: right"]414[/TD]
[TD="align: right"]119[/TD]
[/TR]
[TR]
[TD]City13[/TD]
[TD="align: right"]1133[/TD]
[TD="align: right"]493[/TD]
[TD="align: right"]113[/TD]
[/TR]
[TR]
[TD]City14[/TD]
[TD="align: right"]6390[/TD]
[TD="align: right"]216[/TD]
[TD="align: right"]74[/TD]
[/TR]
[TR]
[TD]City15[/TD]
[TD="align: right"]14740[/TD]
[TD="align: right"]239[/TD]
[TD="align: right"]96[/TD]
[/TR]
[TR]
[TD]City16[/TD]
[TD="align: right"]14906[/TD]
[TD="align: right"]393[/TD]
[TD="align: right"]128[/TD]
[/TR]
[TR]
[TD]City17[/TD]
[TD="align: right"]8281[/TD]
[TD="align: right"]201[/TD]
[TD="align: right"]76[/TD]
[/TR]
[TR]
[TD]City18[/TD]
[TD="align: right"]8301[/TD]
[TD="align: right"]227[/TD]
[TD="align: right"]96[/TD]
[/TR]
[TR]
[TD]City19[/TD]
[TD="align: right"]12784[/TD]
[TD="align: right"]233[/TD]
[TD="align: right"]53[/TD]
[/TR]
[TR]
[TD]City20[/TD]
[TD="align: right"]10000[/TD]
[TD="align: right"]150[/TD]
[TD="align: right"]47[/TD]
[/TR]
</tbody>[/TABLE]
I would like to add more rows and more columns and also to determine the spann of which the items are similar.
For population = 2500, for number of pets = 100 and for number of traffic lights = 20.
If I select City1 similar items would be City2, City10.
Last edited: