Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Month start date

How to get the month start date for eg:11/01/2012 from a date field?

i am trying to do a MTD trend.

1 Solution

Accepted Solutions
Not applicable

Re: Month start date

this is the way i got it worked

sum({ <[Received Date]={">=$(=monthstart(date(max([Received Date]))) )<=$(=monthend(date(max([Received Date]))))"}> }[Loan Counter])

8 Replies
kouroshkarimi
Contributor III

Re: Month start date

=monthstart(yourdatefield) should work?

Not applicable

Re: Month start date

yes that does work is there any way that i could use this and write monthtodate wherein i need the show a trend

eg:

start date:11/01/2012

end date:11/27/2012

do a trend showing all the values, how can i do that?

Not applicable

Re: Month start date

if(month(today())&year(today())=month(Date)&Year(Date),1,0) As MTD_FLAG

Not applicable

Re: Month start date

yes that does work is there any way that i could use this and write monthtodate wherein i need the show a trend

eg:

start date:11/01/2012

end date:11/27/2012

do a trend showing all the values, how can i do that?

MVP
MVP

Re: Month start date

HI,

Create a variable for start and end dates like below

vStartDate = MonthStart(Max(DateDimension))

vEndDate = If(MonthName(Max(DateDimension)) = MonthName(Today()), Today(), MonthEnd(Max(DateDimension)))

Now use this variables in expression

=Sum({<DateDimension = {'>=$(=vStartDate)<=$(=vEndDate'}>} Sales)

Hope this helps you.

Regards,

Jagan.

satyadev_j
Valued Contributor

Re: Month start date

Hi,

Are you talking about daily sales trend for a month? Add below condition in your exression and use the date field as a dimension.

monthstart(datefield)=monthstart(today())

Thx,

Satya

Not applicable

Re: Month start date

Yes i need to show consecutive daily month trend where datefiled range is from

month starting to current date.(eg:11/01/2012 to11/28/2012) each every day count(orders).

Not applicable

Re: Month start date

this is the way i got it worked

sum({ <[Received Date]={">=$(=monthstart(date(max([Received Date]))) )<=$(=monthend(date(max([Received Date]))))"}> }[Loan Counter])

Community Browser