Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
shannonmarshall329
Contributor II
Contributor II

Use variables in sheet actions

I am trying to create a sheet action that selects the last two fiscal years using variables.  When I hard code the values it works fine, when I use variables it does not.  Has anyone used variables for sheet actions?

This way works:  ='2023;2024'

This way works: =$(vCurrentFY)

These ways do not: '$(vCurrentFY);$(vPreviousFY)' or $(vCurrentFY);$(vPreviousFY) 

Labels (1)
1 Solution

Accepted Solutions
shannonmarshall329
Contributor II
Contributor II
Author

I was able to find the solution.  The below worked.

=$(vCurrentFY) & ';' & $(vPreviousFY)

Thanks everyone for the suggestions, it helped me get to the solution.

View solution in original post

7 Replies
marcus_sommer

You may try it with: ($(vCurrentFY)|$(vPreviousFY))

shannonmarshall329
Contributor II
Contributor II
Author

That did not work.  It said "Error in expression" ')' expected".  I added single quotes around the entire thing and it still did not work.

marcus_sommer

How does the result of both variables look like in a text-box?

shannonmarshall329
Contributor II
Contributor II
Author

The values return as 2024 and 2023.  However, when I put the variable in single quotes like '$(vCurrentFY)', I get the code that makes up the variable.

brunobertels
Master
Master

may be 

chr(39)&$(vCurrentFY) & chr(59)&$(vPreviousFY)&chr(39)

shannonmarshall329
Contributor II
Contributor II
Author

That does not work

shannonmarshall329
Contributor II
Contributor II
Author

I was able to find the solution.  The below worked.

=$(vCurrentFY) & ';' & $(vPreviousFY)

Thanks everyone for the suggestions, it helped me get to the solution.