Hi experts,
Need your help in resolving this scenario.
Following is my transaction data
Type | Product | Month | Outstanding Amount |
---|---|---|---|
X | A | Jan | 10 |
X | A | Feb | 10 |
X | A | Mar | -10 |
X | B | Feb | 30 |
X | B | Mar | -30 |
Y | C | Feb | 50 |
Y | C | Mar | -50 |
Firstly, I need to get "outstanding amount as at" each period for each product.
Thus I am using formula: runningsum([amount];([product])) to get my result. It works fine.
Product | Jan | Feb | Mar | Apr |
---|---|---|---|---|
A | 10 | 20 | 10 | 10 |
B | 0 | 30 | 0 | 0 |
C | 0 | 50 | 0 | 0 |
For Product A, outstanding amount as at Feb is 20
For Product A, outstanding amount as at Mar is 10 (10+(-10))
For Product A, outstanding amount as at April is remains 10 (due to no transaction happens)
and so on...
My problem is how do I get count those product having "outstanding amount as at" greater than 0?
Count by Type | Jan | Feb | Mar | Apr |
---|---|---|---|---|
X | 1 | 2 | 1 | 1 |
Y | 0 | 1 | 0 | 0 |
For eg: Type X,
As at Feb, there are two products (product A,B) are having outstanding amount greater than 0.
As at Mar, only one product (product A) having outstanding amount greater than 0
For eg: Type Y,
As at Feb, one product (product C) having outstanding amount
As at Mar and Apr, no product having any outstanding amount
I tried to use count([product]) where (runningsum([amount];([product])))>0, but couldn't give me a correct result.
Anyone has solution on this?
Many many thanks.