Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to find Count of field of last month

Hi,

I need to find the count of Ticket field of last month for 1st of every month,  for november 1st i need count of ticket of october month till 31/10/11

                                                                                                            for  december 1st i need count of ticket of November month till 31/11/11

i.e: i have table like this        Ticket        Date

                                          2               2/10/11

                                          2                3/10/11

                                           2                31/10/11

                                          3               7/11/11 

                                          3               8/11/11

                                           3               31/11/11

for november 1st count is 6

for december 1st count is 9

like this i need to do.

3 Replies
swuehl
MVP
MVP

It will depend what you exactely want to achieve, but for just showing the first of a month with the number of tickets in the prev month, you can do it like

LOAD *,

monthstart( AddMonths(Date,1)) as NextMonthStart

INLINE [

Ticket ,       Date

2,               2/10/11

2,                3/10/11

2,                31/10/11

3,               7/11/11

3,               8/11/11

3,               30/11/11

];

Then create a table chart with dimension NextMonthStart and just use sum(Ticket) as expression.

Regards,

Stefan

Not applicable
Author

Hi swuehl <http://community.qlik.com/people/swuehl>,

I need to in straight table i.e month wise count

nov-11 count will be 6

dec-11 count will be 9

On Fri, Jun 29, 2012 at 3:24 PM, swuehl <

swuehl
MVP
MVP

Yes, understood.

My suggested solution will create that table, you can format the NextMonthstart field as you like

Date(monthstart( AddMonths(Date,1)),'MMM-YY') as NextMonthStart