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

How to use the evaluated variable value as a search string

I can search my data via strings like 2014-Q1, 2015-Q3, etc.

I need to compare the given period with Q4 of the preceding year, eg 2015-Q3 to 2014-Q4, 2014-Q1 ro 2013-Q4, etc. The comparison period is always the Q4 of the previous year.

The filed holding these labels is called year_quarter.

I tried the following.

1. left(year_quarter, 4) as year

2. set vTest=year-1&'-Q4'

The vTest evaluates correctly, but when I try to put $(vTest) in my set expression, I get a syntax error.

I tried year_quarter={$(vTest)}, and year_quarter={"$(vTest)"}, and a number of similar combinations, but I still get an error.

Does anybody know how to solve this?

Please keep in mind that I have no way of altering the original dataset.

Thank you in advance for all your suggestions.

2 Replies
sunny_talwar

Try like this:

year_quarter={"$(=vTest)"}

or

year_quarter={"$(=$(vTest))"}

Not applicable
Author

Thank you.

I tried this, but still got a syntax error.

What ended up working is this:

year_quarter={"$(=year-1&'-Q4')"}


Qlik still grumbled, but all the expressions so far evaluated correctly.