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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
SureshUK
Contributor II
Contributor II

Data island and variable

Hi,

I am trying to use data island to get specific text based on the value calculated in a variable.

The data island model is:

Score, Rating

1, Higher

2, Medium

3, Low

4, Moderate

11,Higher

12, Higher

...

..

444 Moderate

and goes up to the value 444..

I have a variable vRatingCalc which calculates the score in the score for each of the region. I would like to print the rating for the score calculated in the pivot chart.

I tried using the following and it didn't work

if ($(vRatingCalc)=Score, Rating)

I tried using set analysis but still doesn't work

maxstring({<Score="$(vRatingCalc)">}Rating)

I am not sure what I am missing here. Can you please suggest a solution?

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Try this in your Final Rating

= Aggr(IF(Match(Score, $(vVal)), Rating), Score, Code)

View solution in original post

13 Replies
vishsaggi
Champion III
Champion III

What is your expression in your vRatingCalc variable?

Try this?

maxstring({<Score= {$(vRatingCalc)}>}Rating)

SureshUK
Contributor II
Contributor II
Author

This doesn't work. The variable vRatingCalc returns a number between 1 and 444.

vishsaggi
Champion III
Champion III

Ok can you answer my first question please. Can i know the expr you are using in your vRatingCalc variable?

Can you share some sample data? Where are you using this If() condition and your maxstring(), i mean are you using in any chart or tables?

SureshUK
Contributor II
Contributor II
Author

The vRating is an expression formed by concatenating regional rating by using concat and aggr. The resultant is a numeric four digit value.

I am using this in the pivot chart.

zebhashmi
Specialist
Specialist

vRatingCalc = 12

if(vRatingCalc = Score,Rating)

Capture11.PNG

vishsaggi
Champion III
Champion III

Did you try? Can you check what value are you getting for vRatingCalc variable if you put this variable in a textbox.

Check below:

= IF(Score = vRatingCalc, Rating)

SureshUK
Contributor II
Contributor II
Author

I tried that and it prints a number 114. I am sure that the matching row exists in island table too. I even tried storing the value in a column and used the column(1) instead and even that doesn't return any value!

vishsaggi
Champion III
Champion III

Can you share a sample to look into please...

SureshUK
Contributor II
Contributor II
Author

Quickly created a sample file. The chart titled "Derived Score". The Final Rating column is displayed as Null.