Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have the following table
Table:
Date | Domain | Ticket_No |
---|---|---|
01/01/2017 | A | TT1 |
01/12/2016 | B | TT2 |
01/11/2016 | A | TT3 |
01/10/2016 | B | TT4 |
01/09/2016 | A | TT5 |
I want to store only previous 3 months(I want to compare Date with System date and then take previous 3 month data excluding current month) data in Qvd ,and want to group by domain and store count of Ticket_No
in table as follows:
I want to make the table in Script
Output_Table
Domain | Dec-2016 | Nov-2016 | Oct-2016 |
---|---|---|---|
A | 1 | 1 | 1 |
B | 1 | 1 | 1 |
Thanks in Advance
Hi,
LOAD date(Date) as Date,
Domain,
count(Ticket_No) as total_count
FROM Table where date(Date) >= AddMonths(MonthStart(Today()),-3) and date(Date)<MonthStart(Today())
Group by Domain,Date;