Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Reference to "this sheet"

I'm looking for a way to reference the sheet whose properties I'm in.

I have a calculated tab color as follows:

=if(GetActiveSheetId()='Document\SH02',rgb(141,198,63),rgb(0,157,220))

However, I'm getting sick of manually switching the sheet ID ('Document\SH02') on every sheet to make the tab color work properly - I can't set it as the document default, use it in a theme, etc. because it has to be done manually as far as I can tell.

Is there a way to reference "this sheet" so I could do something like:

=if(GetActiveSheetId()=GetThisSheetID(),rgb(141,198,63),rgb(0,157,220))

???

Thanks!

10 Replies
MK_QSL
MVP
MVP

Unfortunately there is no such a function available.

You can use little shorter version as..

if(wildmatch(GetActiveSheetId(),'*SH02'), RGB(141,198,63),RGB(0,157,220))

Colin-Albert

Perhaps an OnActivateSheet trigger could set a variable to 1,2,3 as you change sheet, and then set the tab colour using the variable.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

=if(GetActiveSheetId()=GetThisSheetID(),rgb(141,198,63),rgb(0,157,220))


That expression would always be true, wouldn't it?


If you always want a sheet to have a particular color, can you set that sheet's tab color to a fixed color?


-Rob

Anonymous
Not applicable
Author

The length isn't the problem - It's the needing to edit it individually on each sheet that drives me nuts.

Anonymous
Not applicable
Author

Rob, I'm envisioning the "GetThisSheetID" not as an active sheet id, but the id of the sheet whose properties it's entered in. So if I entered that expression on SH01, GetThisSheetID would always return SH01 in that instance and GetActiveSheetID would always be the active sheet.

Yeah, wishful thinking. But, I'm a techie. When I do something that takes 10 seconds three times or more, I have to look for a way to automate it. xkcd: Automation

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm not sure if you were replying to my post. but my question was why use a conditional expression at all? I think I may be mis-understanding the problem.

-Rob

Anonymous
Not applicable
Author

Hi Rob,

The client has specified different colors for the active sheet tab and inactive sheet tabs. Hence, the conditional. However, copying it to all tabs or including it in the theme includes the current sheet's ID - Meaning that when the sheet I'm in the properties for when I do that is active, ALL the tabs change color. So, I have to go back to every sheet, go into the properties, colors, calculated color, and change the sheet ID to that sheet's ID.

Unfortunately, I did accidentally include this in the theme, so now every time I reapply the theme after a change in the spec, I have to go through the process again! Unfortunately, the theme has been a bit of a moving target so these changes are driving me bananas.

swuehl
MVP
MVP

You may want to vote for

http://community.qlik.com/ideas/1938

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I understand now.

-Rob