There is a requirement where in module 1(Pic 1), there are some transactions and users wants the Last Non-Zero occurrence in Module 2. How we can get the Last Non-Zero data in module 2(Pic 2)? Highlighted are the numbers that we want in module 2.
A simple way to do this would be probably to turn on Time Summaries onto the line item, setting it as "Closing Balance". You'll need to have the "All Periods" time setting on your model/timescale for this to work however.
After you have these, you can then reference the line item with a [SELECT: Time.All Periods]. This will give you the closing balance of that line item overall, which will be the last entered value.
You can create a new line item and use formula , if value<>0 then value else previous(value) and then in module refer that line item[select time.'dec 20'] to get value of last month of timescale which will be last non zero value, alternatively , you can use all periods and select time summary as time:closing balance
As an alternative could you use TIMESUM and the LASTNONBLANK aggregation method?
The start and end position is driven from the CURRENT PERIOD in the time settings so this will need to be taken into account. Also, TIMESUM should only be used when the target module (module2) does not contain time as a dimension.