Discussion Board for collaboration on QlikView Scripting.
I have a requirement to show the max of the percent calculated in variables to display using inline tables.
The max of value can change based on the data, hence using variables.
Inline is used as the fields are adhoc.
Attached is the qlikview file for reference.
Let vsales1 = $(value1) ; (where value1 = max(Percent,1))
Let vsales2 = $(value2) ; (where value2 = max(Percent,2))
(ooxml, embedded labels, table is Sheet1);
Load * Inline [
aabb1@ sales value is $(vsales1)
aabb2@ sales value is $(vsales2)
aabb3@ sales values is null
](delimiter is '@');
the expected result :
the actual result :
Thanks for your replies! !
Go to Solution.
if I understand, see atachment
I don't think you can use a variable within a inline load. You can do something like this, but I doubt it would be very helpful, because it isn't very scalable.
Let vsales1 = 60;
Let vsales2 = 50;
LOAD * INLINE [
fact_key, account, Percent
1, aa1, 50
2, aa2, 60
3, aa3, 40
4, aa4, 30
5, aa5, 20
6, aa6, 10
7, aa7, 11
If(id = 'aabb1', sales & ' ' & $(vsales1), If(id = 'aabb2', sales & ' ' & $(vsales2), sales)) as sales;
aabb1@ sales value is
aabb2@ sales value is
I guess I was wrong. The variable does work in inline load. Adding that to my list of things I know .
Sorry for guiding you incorrectly and thanks Massimo Grossi for guiding me.
This script works fine :
Let vsales1 = 1234 ;
Let vsales2 = 5678 ;
So I would suggest you look at how you load your variable.
Do note that in the script the max() function is only valid when used within a load statement, maybe something like this :
Max(Percent) as MaxPercent
Resident YourTable ;
LET vsales1 = floor(peek('MaxPercent'));
drop table Temp ;
See attached qvw.
Thanks a ton both of you (Massimo and Gysbert) !
Both the solutions works, Unfortunately we can mark only one as correct answer.
this is kalyan i have requirement qlikview to gemfirexd database is it possible connect windows system.
could plz help me,
thanks and advents