Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem with Previous function

Hi,

I have a scenario where if the value of ID  change from Yes(last month) to No (current month) then its status is yes.

I have created the mapping table for the same & perform the applymap after performing the group by using ID and month & order by ID and timestamp

I want to calculate the single status of ID for particular month,but we are getting double status for same ID

  

IDMonthValueStatusTimeStamp
111Jul-17NoF7/13/2017 11:05
111Jul-17NoT7/12/2017 11:46
111Jun-17YesF6/8/2017 11:34
111May-17YesF5/1/2017 16:00
111May-17YesF5/2/2017 16:00
111May-17YesF5/3/2017 16:00
111May-17YesF5/4/2017 16:00
111May-17YesF5/5/2017 16:00
111May-17YesF5/8/2017 16:00
111May-17YesF5/9/2017 16:00
111May-17YesF5/10/2017 16:00
111May-17YesF5/10/2017 17:06

Required output

  

IDMonthValueStatusTimeStamp
111Jul-17NoT7/13/2017 11:05
111Jun-17YesF6/8/2017 11:34
111May-17YesF5/1/2017 16:00
111May-17YesF5/2/2017 16:00
111May-17YesF5/3/2017 16:00
111May-17YesF5/4/2017 16:00
111May-17YesF5/5/2017 16:00
111May-17YesF5/8/2017 16:00
111May-17YesF5/9/2017 16:00
111May-17YesF5/10/2017 16:00
111May-17YesF5/10/2017 17:06
3 Replies
sunny_talwar

Not sure I understand the need for Mapping Table? What exactly are you doing with it? Also, I am not sure I understand the output you are looking to get.... Can you explain the logic?

paulferguson80
Contributor III
Contributor III

Hi Shweta,

I believe this may be what you are trying to do?

Using the previous function you can do the comparison, however i would be careful of 2 points

1 - the start of the file as this will always be null so you will need to default it

2 - the ordering of the data i.e. you may need to change the ordering of the data from the source to get the grouping correct when you have multiple id's and also nest the previous function on the id's to cope with when they change in the data.

Hope this helps

Ta Paul

Anonymous
Not applicable
Author

please the required output sheet