Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can I have variable(s) that is: per sheet?

I want to set a variable linked to sheet. - is that possible?

example:

variable: vMyvar has value 'A' on sheet1, but value 'B' on sheet2

11 Replies
marcus_sommer

Maybe in this way:

vMyvar:

= pick(match(subfield(getactivsheetid(), '\', 2), 'SH01', 'SH02'), 'A', 'B')

- Marcus

katharinakostka
Partner - Contributor III
Partner - Contributor III

Are you using QlikView or QlikSense?

In QlikView there is also the possibility to set actions which set the value of your variable on the event that the sheet is opened. So if you open a sheet the variable will be set to a certain value.

syukyo_zhu
Creator III
Creator III

Hi Marcus,

Does your solution work in qlik sense?

I tried it, but i don't work?

Not applicable
Author

my Question was för Qlik Sense

this post is in the forum section: New to Qlik Sense...

marcus_sommer

I haven't seen that the question was in a sense-area and it won't work in sense. I don't know if there another function then getactivesheetid() to read the active sheet. If not it should be possible with an extension.

- Marcus

shree909
Partner - Specialist II
Partner - Specialist II

I dont think you have an option to show and hide sheets in qliksense.

You can try the extesnions?

Thanks.

Anonymous
Not applicable
Author

You cannot show/hide sheets in Qlik Sense (out of the box) but check out branch.qlik.com for a solution

Anonymous
Not applicable
Author

I think this can help you out...

  • Reference to an individual cell: Sheet_name!Cell_address

        For example, to refer to cell A1 in Sheet2, you type Sheet2!A1.

  • Reference to a range of cells: Sheet_name!First_cell:Last_cell

        For example, to refer to cells A1:A10 in Sheet2, you type Sheet2!A1:A10.

Creating a reference to another sheet in Excel

When writing a formula that refers to cells in another worksheet, you can of course type that other sheet name followed by an exclamation point and a cell reference manually, but this would be a slow and error-prone way.

  • A better way is point to the cell(s) in another sheet that you want the formula to refer to,
  • Let Excel take care of the correct syntax of your sheet reference.

To have Excel insert a reference to another sheet in your formula, do the following:

  • Start typing a formula either in a destination cell or in the formula bar.
  • When it comes to adding a reference to another worksheet, switch to that sheet and select a cell or a range of cells you want to refer to. This can help you more for reference

https://goo.gl/Yig425

Not applicable
Author

getactivsheetid() is not a valid function in Sense.