Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rcorcoran
Creator
Creator

renaming in a label of an expression

Hi

I have a label in a straight table to show the Max ReferredMM and selected year as below:

='WTE  '& (Max(ReferredMM))& ' ' & (GetFieldSelections(ReferredYYYY))

it is working fine but is bringing back:

WTE 3 2016 for march.

I want to rename it to show Mar instead of the 3.

I have a month mapping in my script as follows which works for other things but I can't seem to use it for this any help would be great.

MonthMapping:

LOAD * INLINE [

ReferredMM, Month

1, 'Jan'

2, 'Feb'

3, 'Mar'

4, 'Apr'

5, 'May'

6, 'Jun'

7, 'Jul'

8, 'Aug'

9, 'Sep'

10, 'Oct'

11, 'Nov'

12, 'Dec'

];

18 Replies
sunny_talwar

How about one of these?

='WTE  '& (MaxString({1<ReferredYYYY = {$(=Max(ReferredYYYY)}>}Month)) & ' ' & (GetFieldSelections(ReferredYYYY))

or

='WTE  '& (FirstSortedValue({1<ReferredYYYY = {$(=Max(ReferredYYYY)}>}Month, -ReferredMM)) & ' ' & (GetFieldSelections(ReferredYYYY))

rcorcoran
Creator
Creator
Author

Thank you settu that worked brilliantly

Rhona

rcorcoran
Creator
Creator
Author

Thank you sunny and all. solved.

Rhona

rcorcoran
Creator
Creator
Author

one problem it will show correctly for the current year but if you select the previous year it will show only to the current month of this years data ie

2016 data is in to March 2016

2015 data is in to dec 2015

when I select 2016 the label will show March 2015 instead of dec

Sorry

rcorcoran
Creator
Creator
Author

These sunny have a bracket missing somewhere I am getting an error that I cant seem to fix

Thanks for all this

sunny_talwar

Within the set analysis:

='WTE  '& (MaxString({1<ReferredYYYY = {$(=Max(ReferredYYYY))}>}Month)) & ' ' & (GetFieldSelections(ReferredYYYY))

or

='WTE  '& (FirstSortedValue({1<ReferredYYYY = {$(=Max(ReferredYYYY))}>}Month, -ReferredMM)) & ' ' & (GetFieldSelections(ReferredYYYY))

sunny_talwar

It should show you Dec for when you are in 2015. Have you given it a try?

rcorcoran
Creator
Creator
Author

This is correct also they are both working for me now.

Thank you so much for your great responses

it makes my life so much easier

sunny_talwar

Great -

We are glad we were able to help.

Best,

Sunny