1

This may sound very stupid, but my brain stuck and I can't get it Right.

What I have:

  1. 10 Categories in which a number of Items (Item1, Item2, Item3) are stored.
  2. In a Category there can be 0 or 100000 Items.

What I want:

Based on the item's in the Category, I want to find the Percentage every Category takes up.

These are the variables i have:

$category1_items    <- All items of an Individual Category
$all_items          <- All Items (#)
$all_categories     <- All Categories (#)

I need to calculate $category1_percentage (and of every other category) so that i can display the Percentage of each individual Category.

I can add any other variable i need.

Can someone help me ?

Mini John
  • 115

1 Answers1

3

$category1_items / $all_items $\cdot 100$

Mini John
  • 115
rlartiga
  • 4,205
  • 1
  • 14
  • 24