Hi, im curious to know if this solves the same problem? The answer is correct but i want to make sure my SQL is correct as well in terms of what we’re looking at.
with joined as ( SELECT a.creative_name, a.label, a.activity_kind, a.adid, b.event_name FROM adjust.callbacks a LEFT JOIN adjust.callbacks b ON a.adid = b.adid and b.event_name = 'signup' WHERE a.tracker = 'gxel3d1' AND a.activity_kind = 'click' ), numbers as ( SELECT creative_name, count(distinct(case when event_name = 'signup' then adid end)) as signups, count(distinct(adid)) as total FROM joined GROUP BY 1 ) SELECT *, 100.0*signups/total from numbers order by 2 desc
I have a table with 3 columns: day of month, client_uk, flag_login (Y/N). My task is to group this table over by month to determine what flag_login should be for each month for every client. The client could be login a few time per month, for me, it doesn’t matter and I should determine whether the fact of client login at least 1 time per month. If it’s yes flag_login should Y, in opposite case ‘N’.
I don’t know how to solve it, because my window for window function should be client_uk and month simultaneously.
Thanks for the help in advance!