Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Month start and month end

Hi all,

jagan

I have campaigns which starts on monday and ends on sunday.now i need the counts based on these campaigns and also month wise.

for example:  for month wise counts : in October last week the campaign starts on 26/10/2015 and ends on 01/11/2015.

Now for the October month count i need to exclude this campaigns data and include it to november month count.


My actual concept is if campaign starts in the last month and ends in present month, then My month start or counts should be taken from that campaign start date of the last month, and the month end or counts till the last sunday of the current month.


Example: 1)  October month count: from sep 28th  to   Oct 25th.

               2)  November month count : from oct 26th  to Nov 29th.


Help on this how can i achieve this, through load script or set analysis.


Thanks,

Kumar


            



30 Replies
brunobertels
Master
Master

Hi

May be a simple way could consist in creating a table as master calendar with week number in first field and month number or name as second field so that you've got the requiered period ?

Something like that :

 

WeekMonth
1déc-14
2janv-15
3janv-15
4janv-15
5janv-15
6févr-15
7févr-15
8févr-15
9févr-15
10mars-15
11mars-15
12mars-15
13mars-15
14avr-15
15avr-15
16avr-15

Bruno

Not applicable
Author

How can i get the weeks of present month or last month

Not applicable
Author

week.png

In the image we can see for the month sep i need the count of only week_number {36,37,38,39} not 40.

same for October  40,41,42,43 not 44 how can i do this

brunobertels
Master
Master

Hi

Use this expression

month(weekend(date))

See App attached it's working

Not applicable
Author

i think you dint get my problem, 1/1/2015 belongs to weekstart 29/12/2014 i agree,

when i calculate the count i need the count from 29/12/2014 to 25/01/2015

For ex: count({$<month= jan>}invitation_id)

for above expression it should return the count from date 29/12/2014 to 25/01/2015

Same way for feb from 26/01/2015 to 22/02/2015

count({$<month= jan>}invitation_id)



brunobertels
Master
Master

Hi

it work if you use this expression as month dimension :

add this in your script :

month(weekend(canonicaldate)) as MonthPeriod

so you will have in your expression :

For ex: count({$<MonthPeriod= jan>}invitation_id)

Bruno

Not applicable
Author

Thanks it'  working,

But how can i get the present month and previous month without hardcoding the month

brunobertels
Master
Master

Like this

current month :

For ex: count({$<MonthPeriod= max(MonthPeriod)>}invitation_id)

previous month :

count({$<MonthPeriod= max(MonthPeriod)-1>}invitation_id)

Bruno

reddy-s
Master II
Master II

Hi pramodgc3,

Simply use this to get Previous Month:Month(AddMonths(Today(),-1))

And for This Month use : Month(Today())

Thanks and Regards,

Sangram Reddy.