Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

monthstart to today

I am trying to caluculate or populate dates from month start to today...I am using following code....

Order_date =  {">=$(=monthstart(today())<=$(=today())"}

but I am unable to populate....can anyone please correct me.....

Labels (1)
6 Replies
Anonymous
Not applicable
Author

447,

It will be
= {"$(='>=' & date(monthstart(today())) & '<=' & date(today()))"}

(count my open/close parenthesis)

Regards,

Michael

Not applicable
Author

Thankyou, its working great....but if I want for different dates its not working.....for example I am selecting  month as dec and year as 2012.....I want it to populate from dec 1st to today...depending on whatever month they selected...can you please help me with this......

Not applicable
Author

I am having day month and year fields for order_date.....

Anonymous
Not applicable
Author

If you wabt to get data from the start of the selected month to the day nbumber of the selected month equal to the current date, try this:

= {"$(='>=' & date(min(order_date)) & '<=' & date(makedate(year,month,day(today()))))"}

(assumong your month field is dual and has a numeric value)

Regards,

Michael

Not applicable
Author

When I selected Dec I am getting dates for Dec but if no selections are made can I keep default to MTD to today......as you given in first expression......

Anonymous
Not applicable
Author

The simplest way is to use conditional expression, something like this:

if(GetSelectedCount(month)=0,

     <expression with = {"$(='>=' & date(monthstart(today())) & '<=' & date(today()))"}>,

     <expression with = {"$(='>=' & date(min(order_date)) & '<=' & date(makedate(year,month,day(today()))))"}>)

There could be a more elegant solution, I'll try to get back to it.

Regards,

Michael