Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ananyaghosh
Creator III
Creator III

FirstSortedValue cannot be used in script

Hi,

I have done this thing:

Employee:

load * Inline [

Employee ID, Age, Customer Name, Sales

Sandip Ghosh, 34, Customer1, 1000

Ananya Ghosh, 29, Customer2, 1200

Amit Das, 35, Customer3, 3000

Kaushik Dhar, 55, Customer4, 5400

Sudhir Ghosh, 74, Customer5, 5980

Sandip Ghosh, 34, Customer6, 54670

Sandip Ghosh, 34, Customer7, 45675

Kaushik Dhar, 55, Customer8, 15400

Kaushik Dhar, 55, Customer9, 45400

Sudhir Ghosh, 74, Customer10, 6598

Ananya Ghosh, 29, Customer2, 16200

Sudhir Ghosh, 74, Customer5, 5980

Sudhir Ghosh, 74, Customer6, 2980

Ananya Ghosh, 29, Customer2, 12900

Ananya Ghosh, 29, Customer2, 12070

];

LET vHighestSalary = FirstSortedValue([Customer Name], -Sales);

SET vSalary =  'Highest Salary = ' & vHighestSalary;

Now show the variable in textbox object as =$(vSalary), but it only show  'Highest Salary = ' and value is not showing.

12 Replies
ananyaghosh
Creator III
Creator III
Author

Can u tell me what is the use of double equals to(=) and $ sign here? or why I am using = sign insight the () ?

Please give an explanation with an example.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

There is no double equal sign in my examples. Moreover, you won't need it.

This is the theory:

  • The first equal sign is necessary for QlikVies to interprete the text as an expression (just like in Excel). First the text after the first equal sign will be evaluated as a regular QlikView expression and the result of evaluation will be used/displayed.
  • $-sign substitution always comes before any evaluation.
  • Usually a $(varname) construct will we replaced by the text value that is stored in variable varname. Varname can be prefixed by one of two 'modifiers':
    - a # means substitute with the numerical value of varname
    - a = means substitute with the result of evaluating the text after the equal sign (again an expression)

Best,

Peter