Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rish
Contributor III
Contributor III

Month Created from date not working properly for selection

Hi,

I have created a month field using the formula Date(Datefield, 'MMM YYYY') from a date field that was available in the data and using that month field as filter. The data is sort of like the example below:

Date               Month

1/1/2019         Jan 2019

1/2/2019         Jan 2019

2/2/2019          Feb 2019

3/3/2019           Mar 2019

3/3/2019           Mar 2019

3/4/2019           Mar 2019

If I feed this data to qlik sense and use the month field in a filter pane, the filter pane should display only 1 entry for each month, so for the above i should get have only 3 options viz. jan 2019, feb 2019, mar 2019. But the filter is displaying 2 entries for jan,1 for feb and 2 for march for some unknown reason, and it seems to be attached to the date. So mar 2019 has 2 options even though there are 3 entries for march, and one of them will filter the data and give me the 2 rows related to 3/3/2019 and i have to select the other mar 2019 option from the filter to select the entry for 3/4/2019.

In simple words, the month field is not performing cumulative selection, but instead it is performing selection based on dates. It'd be great if someone could help me with this issue. Thanks.

3 Replies
Anil_Babu_Samineni

that means month field is not calculating all merge rcows. Perhaps this

Date(Floor(Datefield), 'MMM YYYY')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Vegar
MVP
MVP

Even if you  format your date 1/2/2019 as MMM YYYY it will still have its underlying numeric value. You need to calculate a common number for all January entries and a common for all February entries etc.

 

This is one approach you can do:

Date(monthstart(Datefield), 'MMM YYYY') as Month

 

This is a similar one but you get the qlik predefined year month formatting:

Monthname(Datefield) as Month

 

Or
MVP
MVP

MonthName(YourDate) will work nicely here.