In these scenarios, you have to use synthetic dimensions. You have to use Valuelist function to create synthetic dimension to have such format.
Is it only three types avaiable or there are more?
Is it just after Type 2 you need ratio or after every type you need ratio from above?
This could be done in load script using peek() and creating new fields for amount_%_prev, received_%_prev
If (type=2 or type=4 or type=5 or type=8 or type=9, (peek(amount,-1)-amount) *100) as amount_%_prev
there would need to be an order by customer (or some key)/date/type so that the previous record is the prior type.