Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Very new to QV. My data is order numbers with multiple events. I'm trying to flag when an order has both an 2 and 4 event.
Order Event
123456 6
123456 2
123456 9
123456 4
If order number 123456 has both a 2 and 4 event create flag 1 else 0.
Not able to get it to work, only able to identify if it has one or the other. Any help is very much appreciated.
Hi Kerri,
Using Peek() and Previous() function should work. See sample codes in
Cumulative calculation at script level
Counting the number of times a word appears at the detail level
Miguel
source:
load * inline [
Order , Event
123456 , 6
123456 , 2
123456 , 9
123456 , 4
1,2
1,3
2,4
2,5
3,6
3,7
3,8
];
Left join (source)
load Order, if(count(Event)=2,1) as cnt
resident source
where match(Event, 2,4)
group by Order;