I have following touch points:
Session Number Source
1 direct
2 social
3 paid
4 direct
5 direct
6 direct
I need to pick the Last-Non Direct source… which is paid in this example (session 3).
Take into consideration that it can be cases that have just direct and then direct should be displayed. So basically we need to have the same as Google Analytics does : Last Non-Direct Attribution.
What SQL code can do that?