Hi All,
I am having a data as attached below for each date in asset_changedate column. What i am trying to achieve is to group the data by asset number and asset status,by dividing the changedate in month intervals, starting from the present date, for any number of past years.
For ex, I need to find the total number of ACTIVE status rows for an asset in last month(starting from the present date when the flow runs), and then total number in previous month and so on.... And similarly for other statuses.
How could i achieve this?
asset_number | asset_status | asset_changedate |
1280481008 | ACTIVE | 5/22/2016 0:00 |
1280481008 | ACTIVE | 5/24/2016 0:00 |
1280481008 | ACTIVE | 5/26/2016 0:00 |
1280481008 | ACTIVE | 5/28/2016 0:00 |
1280481008 | ACTIVE | 5/30/2016 0:00 |
1280481008 | OOS | 9/11/2016 0:00 |
1280481008 | OOS | 9/13/2016 0:00 |
1280481008 | OOS | 9/15/2016 0:00 |
1280481008 | OOS | 9/17/2016 0:00 |
1280481008 | OOS | 9/19/2016 0:00 |
80920 | OOS | 8/5/2016 0:00 |
80920 | OOS | 8/7/2016 0:00 |
80920 | OOS | 8/9/2016 0:00 |
80920 | OOS | 8/11/2016 0:00 |
80920 | OOS | 8/13/2016 0:00 |
80920 | ACTIVE | 8/15/2016 0:00 |
80920 | ACTIVE | 8/17/2016 0:00 |
80920 | ACTIVE | 8/19/2016 0:00 |
80920 | ACTIVE | 8/21/2016 0:00 |
80920 | ACTIVE | 8/23/2016 0:00 |
Solved! Go to Solution.
Here's an option:
In this example, "0" months will be assets that changed in the last month, then "1" will be from the month prior, etc. Month difference should be calculating based on the same day in the comparison month, so if you wanted to use a standard 28 days or something, you'd need to change from "months" to "days" and divide by your standard day count, etc.
Take a look at the attached workflow - I added a few more dates to check that it was working, seems to get the results you're looking for! Let us know if that works. Otherwise might help to see a sample of what you expect the output to look like? Thanks!
NJ
Hello Nicole,
Thanks for your inputs. It got me the output i needed.
Could there be a way to group the data per month wise also, for the same set of data?
For ex, if today is 24th May. I get the count of ACTIVE status in 24 days of May, April, March and so on, for past years data.
Thanks,
Gaurav
Got this working.
Thanks.
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
5 |