Nested Group loops and rule to identify a case

Serial Number Date Source Prediction column
1 15.11.2015 A 0
1 15.11.2015 A 0
1 17.03.2016 B 0
1 17.03.2016 B 0
1 19.08.2016 A 1
1 19.08.2016 B 1
2 20.06.2014 A 1
2 20.06.2014 B 1
2 20.06.2014 B 1
2 30.07.2015 A 0
2 30.07.2015 A 0
2 30.07.2015 A 0

 

I would like to create the "prediction column". 

I want to know per serial number and per common date (serial number), which of these common dates have A and B appearing as a source.

 

I know that I need to do two group loops(nested),

The first group loop would be by Serial number, the next group loop would be by date and then I struggle how to

write the appropriate rule. I am searching for something like: if source=A AND source=B then put 1 to the prediction column.

Looking forward to a reply,

Cheers.

Hi Atzitzi,

this is exactly what I would have done as well :-)

By the way, if you change the method in the group by to Set you can use the standard row filter and don't have to write the rules yourself.

Cheers, Iris 

Resolved.

I think I overcomplicated my life by using group loop.

How I solved it?

I took a group by node and grouped based on date and serial number and manual aggregation source (unique concatinate with count).

 

Then, I took a rule based row filter and, since source B was the once I was most interested in, I did the following:

$Unique concatenate with count(source)$ LIKE "*B*"=>TRUE

Then I took again a rule based row filter and did:

$Unique concatenate with count(source)$ LIKE "*,*"=>TRUE

So, I got a the first table all the A,B and on the second table all the B.

:)

 

If someone has a better idea, feel free to share!