I need little help with one of my scripts. Below, I have script which can "flag" first invoice of customer based on date. But I also need to "flag" all sales of this customer in month of his first invoice. For example his first invoice was in Jan 2019 but he also had other invoices in Jan 2019. I need to flag all of his invoices in that month. Column FirstMonths_Invoices_flag in picture.
FROM [lib://InvoiceItem_D.QVD] (qvd);
min(Invoice_item_generated_datetime) as MinInvoice
Group By Invoice_item_user_id;
MinInvoice as Invoice_item_generated_datetime,
'FirstInvoice' as Invoice_user_first_invoice_attribute