Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

this is the way i got it worked

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

View solution in original post

8 Replies
kouroshkarimi
Creator III
Creator III

=monthstart(yourdatefield) should work?

Not applicable
Author

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
Author

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

Not applicable
Author

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?

jagan
Partner
Partner

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
Specialist
Specialist

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
Author

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
Author

this is the way i got it worked

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