Change metadata group calculation

Use required for analysis filter when calculating metadata group