Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a calculated value to link to data

Hi:

I have a chart where I am calculating an average from the data returned, using:

=ROUND(RangeAvg(

FirstSortedValue({$<1_RATINGDATE={"<=$(=cal_RATINGDATE)"}>}  1_RATINGVALUE, -1_RATINGDATE),

FirstSortedValue({$<2_RATINGDATE={"<=$(=cal_RATINGDATE)"}>}  2_RATINGVALUE, -2_RATINGDATE),

FirstSortedValue({$<3_RATINGDATE={"<=$(=cal_RATINGDATE)"}>}  3_RATINGVALUE, -3_RATINGDATE)

))

Lets say this returns the value 5.

I then would like to look up a corresponding value in a table using the result:

RTNG_BUKRTNG_COMPVALUE
AA6
AA-7
AA+5
AAAA3
AAAA-4
AAAA+2
AAAAAA1

when I use

=only({<VALUE={5}>} RTNG_COMP) I get the correct corresponding value, however when I substitute the above formula for the 5 it does not work.


Any ideas?

1 Reply
hic
Former Employee
Former Employee

The data model (and the links) cannot be changed by user selections. It must be defined in the script. So your formulae using set analysis must be re-written using if() functions or where-clauses, and put in the script. Then it will work.

But it will not be sensitive to user selections.

HIC