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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Month selection in column headers

Hi,

We want column headers in columns as following

if in month listbox continuous months are selected, i.e Jan, Feb , Mar  then  'Jan to Mar'

otherwise if Jan and March selection then concatenation of Months as 'Jan,Mar' in column headers.

Please me if some one has done same thing in past.

Regards,

Navdeep

11 Replies
martinpohl
Partner - Master
Partner - Master

Take this:

=if(num(max(Month))-num(min(Month))+1=GetSelectedCount(Month),maxstring({<Num={$(=min(Num))}>}Month)&'-'&maxstring({<Num={$(=max(Num))}>}Month)

,concat(Month,','))

Add a field Num in your calendar where the monthnumber is in.

Unfortunaly the concated values of months are sorted by string, not by number,

Regards

Not applicable
Author

=IF(GetSelectedCount(FieldName)>2,LEFT(GetfieldSelections(FieldName),3)&' to '&RIGHT(GetfieldSelections(FieldName),3),GetfieldSelections(FieldName))