Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
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))
Percent:
LOAD fact_key,
account,
Percent
FROM
(ooxml, embedded labels, table is Sheet1);
Sales:
Load * Inline [
id@ sales
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! !
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;
Percent:
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
];
Sales:
LOAD id,
If(id = 'aabb1', sales & ' ' & $(vsales1), If(id = 'aabb2', sales & ' ' & $(vsales2), sales)) as sales;
Load * Inline [
id@ sales
aabb1@ sales value is
aabb2@ sales value is
aabb3@ sales values is null
](delimiter is '@');
if I understand, see atachment
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.
Best,
Sunny
Harshala
This script works fine :
Let vsales1 = 1234 ;
Let vsales2 = 5678 ;
Sales:
Load * Inline [
id@ sales
aabb1@ sales value is $(vsales1)
aabb2@ sales value is $(vsales2)
aabb3@ sales values is null
](delimiter is '@');
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 :
Temp:
LOAD
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.
hi all
this is kalyan i have requirement qlikview to gemfirexd database is it possible connect windows system.
could plz help me,
thanks and advents
kalyan