Hi I have lists grouped by level showing each rooms occupancy. I am trying to count these occurrences of units per level and arrange them in a particular order before exporting the values to excel.
Below is the original list of “occupancy” values organized per level.:
-[0]
—[0]1 BED
—[1]1 BED
—[2]1 BED+ST
—[3]2 BED
—[4]3 BED
—[5]3 BED+ST
—[6]3 BED+ST
-[1]
—[0]3 BED+ST
—[1]3 BED+ST
—[2]2 BED+ST
—[3]2 BED
—[4]1 BED
—[5]1 BED
—[6]1 BED
I want to count occurrences but order them by a defined list as shown below:
-[0]
—[0]1 BED
—[1]1 BED+ST
—[2]2 BED
—[3]2 BED+ST
—[4]3 BED
—[5]3 BED+ST
Therefore I can produce total counts of “1 BED”, “1 BED+ST”, etc. per level in a specific order like below…
-[0]
—[0]2
—[1]1
—[2]1
—[3]0
—[4]1
—[5]2
-[1]
—[0]3
—[1]0
—[2]1
—[3]1
—[4]0
—[5]2
Where there is no occurrence I want to produce just a “0” instead of “null”.
Any help would be appreciated!