Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Hi
It needs to be in a load statement:
T_Fsv:
LOAD FirstSortedValue([Customer Name], -Sales) As Fsv
Resident Employee;
Let vHighestSalary = Peek('Fsv');
Let vSalary = 'Highest Salary = ' & vHighestSalary;
DROP TABLE T_Fsv;
HTH
Jonathan
You can directly write the below expression in Text box or you assign the FirstSortedValue() expression to a variable in UI using Variable overview
='Highest Salary = ' & FirstSortedValue([Customer Name], -Sales)
If semicolon is used at the end of the script it will give garbage error. So drop that semicolon : ;
You are right. Fixed the previous post
Can it be written as:
T_Fsv:
LOAD [Customer Name], max(Sales) As Fsv
Resident Employee group by [Customer Name];
Let vHighestSalary = Peek('Fsv');
Let vSalary = 'Highest Salary = ' & vHighestSalary;
DROP TABLE T_Fsv;
Or change your script by dropping the LET vHighestSalary... statement and modifying the SET statement into something like:
SET vSalary='Highest Salary = ' & FirstSortedValue([Customer Name], -Sales);
No need to change any expressions in the UI.
I have tried this:-
LET vHighestSalary = FirstSortedValue([Customer Name], -Sales);
SET vSalary = 'Highest Salary = ' & vHighestSalary;
but it does not work for me.
LET vHighestSalary = 'FirstSortedValue([Customer Name], -Sales)';
SET vSalary = 'Highest Salary = ' & $(vHighestSalary);
In Text box, use this expr
=$(=vSalary )
That's because the LET statement evaluates the expression on the right of the equal sign, and that part is invalid (or doesn't return a value).
The SET statement doesn't do a such thing. It just stores everything after the equal sign as literal text in your variable for later use.
Drop the LET statement, and use the SET statement version from my post.
Or use the version that Anbu posted.