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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to customize the date

I have attached a qv application. It will have data received as a date column and i have below query to get year, day and month.

year([Date Received]) as year,

day([Date Received]) as day

,Month([Date Received]) AS Month

Now the main thing i need is a new field month which should satisfy the below thing , whenver i include month as a list box it should show the jan month to current month.

Examples:

forFebruary 2012 you would pull January 2012 and February 2012 YTD info

forMarch 2012 you would pull Jan 2012, Feb 2012 and Mar 2012 YTD info

15 Replies
Not applicable
Author

When i implemented your logic in my application , table 2 is showing - instead of values.Even after doing the left join with table 1 , table 2 is not having values. Can you suggest anyother method to get the completed months, either it can be in front end or in script.

Not applicable
Author

Can you attach a screenshot of what's going wrong in the final display.  Sorry, I'm having difficulty understanding what problem is occuring.

Thanks,

Brandon

Not applicable
Author

Hi Brandon,

When you check the table view for table2 , field Month2 is swowing - .But if you pul it as a field in front end we can see the completed months. 

And please explain the concept of this query , since with this single query you are getting the completed months of 2012 in month2.

IF(year([Date Received]) = '2012' and  day(monthend([Date Received])),text(Month([Date Received]))) as Month2

Not applicable
Author

Hi Brandon,

Can you please help me out in the earlier application. You made it work like the way i said. Can you help me out for the scenario, when i select the year as 2008 or 09 or 10 or 11. It should display all the month (completed months of that year) but when i select 2012 it should show only the completed month.

Regards,

Gerard

Not applicable
Author

The idea behind this:

IF(year([Date Received]) = '2012' and  day(monthend([Date Received])),text(Month([Date Received]))) as Month2

Is if data exists for 2012 and the last day of a particular month,  then you know that month has been completed so you want to compile your list of months.  (Of course this might break if you have completed a month but you do not have data on the last day of the month, I was assuming you did).  This stores just Jan, Feb, Mar etc... of the completed months into Month2.

Then the idea is to left join that Month2 field to the original month field.  That is everything that exists in Month2 that matches Month, but excludes the months that aren't completed.

What has been happening now that needs repairing?  Maybe if you attach the application I can try and assist you better.

Thanks

Not applicable
Author

Hi Brandan,

Need a help, even if there is data for all months of 2012. I want to show only till the current month. The month field for 2012 should be till may(current month) , the other month should not be visible.This is for both list box and multi box.