- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Community,
I have a dataset where I need only to change the red vs2 date to a day later (in below the first vs2 date really should be 24APR2015:00:06:00) and the last vs2 date really should be 22NOV2017:00:04:00, while the other dates should remain the same.
How should I handle situation like this? Thanks as always
vs1 | vs2 |
23APR2015:23:51:00 | 23APR2015:00:06:00 |
05MAY2015:13:00:00 | 05MAY2015:12:59:00 |
06JUN2015:18:52:00 | 06JUN2015:18:52:00 |
23AUG2015:23:32:00 | 23AUG2015:23:30:00 |
10SEP2015:20:39:00 | 10SEP2015:20:32:00 |
23SEP2015:21:48:00 | 23SEP2015:21:44:00 |
07DEC2015:12:45:00 | 07DEC2015:12:27:00 |
21NOV2017:23:40:00 | 21NOV2017:00:04:00 |
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do you mean you want to make the change if vs2 is more than an hour before vs1?
if vs1 - vs2 > 3600 then vs2 = intnx('dtday',vs2,1,'s');
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is there logic for why those two need to change? Or do you just want to test for any value on those dates?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for inquiring, those values in red are the correct values, basically vs2 should start a few minutes after vs1, so the situation is vs1 and vs2 just happens to cross the midnight, while the other values have issues which I don't want to program to change, they need further investigation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How do you identify the dates that need to be changed?
The function for calculation of intervals is intnx(). Use "dtday" as interval.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for inquiring. I plan to use
vs1_2 = INTCK('hour',vs2,vs1);
vs1_2 = 23;
to indentify those values across the midnight.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do you mean you want to make the change if vs2 is more than an hour before vs1?
if vs1 - vs2 > 3600 then vs2 = intnx('dtday',vs2,1,'s');
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I should add 24 hours to vs2 to bring vs2 one day ahead of its current status, that is my plan, just like to consult the experts here