Here is a dummy dataset to illustrate my question:
[TABLE="class: grid, width: 391"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Client_Ref[/TD]
[TD]Start_of_Payment Month[/TD]
[TD]Payment_Amount[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[TD="align: right"]01/01/2018[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[TD="align: right"]01/02/2018[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[TD="align: right"]01/03/2018[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]102[/TD]
[TD="align: right"]01/01/2018[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD="align: right"]102[/TD]
[TD="align: right"]01/02/2018[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]102[/TD]
[TD="align: right"]01/03/2018[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]
I am wondering if it is possible to write measures that would enable me to count how many clients in one month have paid more / less / the same compared to the previous month.
The resulting pivot from the above would look as follows:
[TABLE="class: grid, width: 515"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD]No of Clients with Payment Higher than Previous Month[/TD]
[TD]No of Clients with Payment Lower than Previous Month[/TD]
[TD]No of Clients with Payment Same as Previous Month[/TD]
[/TR]
[TR]
[TD="align: right"]01/02/2018[/TD]
[TD="align: right"]1[/TD]
[TD] [/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]01/03/2018[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"] 1[/TD]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]
If anyone could advise how to write the measure for the "higher" example, this would be much appreciated.
(In this example, each client makes just one payment per month. I would also like to understand how the measure would need to be adapted if clients made several payments per month i.e. if I need to compare the sum of payments in two months).
Thank you in advance!
[TABLE="class: grid, width: 391"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Client_Ref[/TD]
[TD]Start_of_Payment Month[/TD]
[TD]Payment_Amount[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[TD="align: right"]01/01/2018[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[TD="align: right"]01/02/2018[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[TD="align: right"]01/03/2018[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]102[/TD]
[TD="align: right"]01/01/2018[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD="align: right"]102[/TD]
[TD="align: right"]01/02/2018[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]102[/TD]
[TD="align: right"]01/03/2018[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]
I am wondering if it is possible to write measures that would enable me to count how many clients in one month have paid more / less / the same compared to the previous month.
The resulting pivot from the above would look as follows:
[TABLE="class: grid, width: 515"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD]No of Clients with Payment Higher than Previous Month[/TD]
[TD]No of Clients with Payment Lower than Previous Month[/TD]
[TD]No of Clients with Payment Same as Previous Month[/TD]
[/TR]
[TR]
[TD="align: right"]01/02/2018[/TD]
[TD="align: right"]1[/TD]
[TD] [/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]01/03/2018[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"] 1[/TD]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]
If anyone could advise how to write the measure for the "higher" example, this would be much appreciated.
(In this example, each client makes just one payment per month. I would also like to understand how the measure would need to be adapted if clients made several payments per month i.e. if I need to compare the sum of payments in two months).
Thank you in advance!