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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get title of sheet

Hi,

Is there a function or a way to get automatically the title of a sheet? E.g if you have a sheet named Sales, have a text that shows Sales, which gets automatically updated as you change the sheet's title?

1 Solution

Accepted Solutions
israrkhan
Specialist II
Specialist II

you can use GetActiveSheetId() function, and Default Sheet id are Sh001, Sh002 and so on,

but you can change them to Sales, Purchase, and so, and the use GetActiveSheetId() in text object, you will get it...

View solution in original post

9 Replies
swuehl
MVP
MVP

You can use a Macro to get the sheet name, but I try to avoid macros.

You can create a variable for every sheet name, then use the variable in all the expressions needed (as well as in the sheet properties itself).

Not applicable
Author

Thanks, I thought of the variable but I wanted to see if there is something simple like a function.

israrkhan
Specialist II
Specialist II

you can use GetActiveSheetId() function, and Default Sheet id are Sh001, Sh002 and so on,

but you can change them to Sales, Purchase, and so, and the use GetActiveSheetId() in text object, you will get it...

swuehl
MVP
MVP

There is a function to get the sheet ID:

GetActiveSheetID()

If you just want a simple string, no dynamic expression in your sheet title, you can try using the name as ID, then call GetActiveSheetID().

Not applicable
Author

Thanks, nice one. But I get something like Document\Sales instead of Sales. Any idea? I could call another function like ignore the first nine characters though...if there is such.

swuehl
MVP
MVP

Try

=subfield(GetActiveSheetID(),'\',2)

ngulliver
Partner - Specialist III
Partner - Specialist III

Alternatively, you can create a variable (vSheetName) and set an action at sheet opening in Sheet Properties to populate the variable with a name.

Obviously, this would have to be done for each sheet but it would give you whatever name you chose.

Regards,

Neil.

Not applicable
Author

Thanks! It works fine. You can actually fill in only the Sheet ID and get the Sheet's title and the text or any other field updated by the function

Anonymous
Not applicable
Author

Hi,

I have this issue in the Past.

The only way that I could do that, was using a simple inline with the Sheet name and ID, and then Using na expression. to get the name, as in:

= FieldValue('SheetName', FieldIndex ( 'SheetID', GetActiveSheetID() ))

Do not know if is the best solution, but it Works:

Sheets.png

Please check attached.

Regards