Okay I've got a keyword. Under each keyword can be multiple retail categories with a specific number of orders per category.
Keyword category orders
diamond gemstones 100
diamond jewelry 20
diamond supplies 8
ruby gemstone 10
ruby jewelry 9
ruby books 1
sapphire jewelry 10
What I need to do is show which category is most prevelant, but only if there is a variance of 20% or more between the first and second. And if there is only one, then show the one.
the result from above should be
keyword category percentage
Diamond gemstones 78.125%(100/128)
ruby - -
sapphire jewelry 100%
I'm assuming a cursor but not sure how to compare if there are more than 2(could be as many as 6) categories. Your help is greatly appreciated.
Keyword category orders
diamond gemstones 100
diamond jewelry 20
diamond supplies 8
ruby gemstone 10
ruby jewelry 9
ruby books 1
sapphire jewelry 10
What I need to do is show which category is most prevelant, but only if there is a variance of 20% or more between the first and second. And if there is only one, then show the one.
the result from above should be
keyword category percentage
Diamond gemstones 78.125%(100/128)
ruby - -
sapphire jewelry 100%
I'm assuming a cursor but not sure how to compare if there are more than 2(could be as many as 6) categories. Your help is greatly appreciated.