Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey Folks,
I have a requirement as if the Current Year from ( Year table as from 2011 to 2019) and Current Month Data is not available on the particular field then I have the take the value from the previous month table,
Assume that if i have a value on Oct 2018 and till Jun 2019 I have no value in between tables. So How should i apply logic in this case.
I need the Oct 2018 Value should be displayed on Jun 2019 field...
So how should I perform
Thanks in advance...!!!
Hi, using peek() or previous() you can access to last record loaded, for this you need a sorted load, ie:
LOAD KeyFields,
Date,
If(Conditions, Value, Peek(Value)) as Value // If conditions are true load Value, else loads the Value of the last record
From/Resident...
Order By KeyFields, Date;
Thanks for your reply but i tried using your function still i cant fetch the data from the table table.
Can you post a sample to show what are you trying to do?
I need the Oct 2018 Value should be displayed on Jun 2019 field...
So how should I perform
My Exact Data is:
Load
Values, Month, Year
0.001, Jun , 2016
0.002, Jul, 2016
0.003, Aug, 2016
0 , Oct, 2016
0 , Nov, 2016
0 , Dec, 2016
0 , Jan, 2017
0 , Feb, 2017
0 , Mar, 2017
0 , Apr, 2017
0 , May, 2017
0 , Jun, 2017
Now I need the Value of Aug, 2016 as my Current month Value as my Current Month is Jun, 2017.
Now is my Question Clear?
Sample attached.
1- Original data creating date
2- Sorted load to propagate last value till last month
3- Load sorted descendent, if value of the first row (most recent date) is zero it takes the propagated value.
Anto, did Ruben's final example do the trick for you? If so, please consider clicking the Accept as Solution button on that post to give him credit for the help and to let everyone else know that worked.
Regards,
Brett