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: 
richard24best
Creator II
Creator II

Title Change of a Column name in Straight table

Hi Team,

I have requirement to change the title of a column when user click on button

Button - '=WildMatch([Priority],''Undefined'')=0' (using toggle field function under actions)

Not sure how to i change the Column title from 2023 YTD to Priority YTD when user clicks on the above button.

I did try to create a variable vPriorty equal 1

and in label used =if([vPriorty ]=1 ,'2023 YTD', if([vPriorty ]=2,'Priority YTD')) but unable to get what's expected

Appreciate your time and support in advance.

 

Labels (3)
1 Solution

Accepted Solutions
Lokesh_5045
Creator
Creator

Can you give me a sample data in Excel? or give me random data which is similar to yours.

View solution in original post

9 Replies
Lokesh_5045
Creator
Creator

Try $(vPriorty).

richard24best
Creator II
Creator II
Author

Hi Lokesh,

Thanks for your response, i am getting column as blank when i use  $(vPriorty)

Regards,

Richard

Lokesh_5045
Creator
Creator

Can you provide the details a bit more clearly? Is the button used to select the values in a field? or Is the button used to change variable's value?

richard24best
Creator II
Creator II
Author

Sure,

I am using a button called Priority to filter certain values using Toggle selection where Field value = Priority

'=WildMatch([Priority],''Undefined'')=0' excluding everything with a field which is been tagged as Undefined.

Now my requirement is that currently in a table i would be showing all values for 2023 YTD (including Priority + Undefined)

the moment user clicks on Priority button he would be seeing only values related to priority which is working fine.

But to avoid confusion i would like to change the column header from 2023 YTD to Priority YTD.

Currently i defined variable as vPriority = 1

and in lable expression of the value using as if([vPriorty ]=1 ,'2023 YTD', if([vPriorty ]=2,'Priority YTD'))

Please do let me know if you need more details.

Lokesh_5045
Creator
Creator

I guess there's no relation between button and variable value.
Try add one more action in button properties. 'Set variable value'

Lokesh_5045_1-1688711605648.png

Select the corresponding variable and assign the value as 2.

In field label, use the following script.

if($(vPriority) = 1, '2023 YTD', 'Priority YTD')

richard24best
Creator II
Creator II
Author

I have setup already as mentioned above. but still its working 

if($(vPriority) = 1, '2023 YTD', 'Priority YTD')

when Clicked or not its just showing only one title '2023 YTD'. Not sure why the second condition is getting failed.

Lokesh_5045
Creator
Creator

Can you give me a sample data in Excel? or give me random data which is similar to yours.

richard24best
Creator II
Creator II
Author

Hi Lokesh,

I fixed it, it worked when i setup like below

Variable setup

vPriority = 0

Button - Set variable variable 

Variable - 'vPriorty' and value  = if($(vPriority)=1,0,1)

Lokesh_5045
Creator
Creator

Great. Sometimes, its just an idea that we need. Hope my suggestion gives you a pathway to find solution.