Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Experts,
I am having some trouble to create a dynamic variable in Qlik.
I am doing as below.
Below is the data.
key, code
1,x
2.y
3,z
Variable : vkey=Max(Key)
which will set 3 as a value.
now how can i set the variable 2 as a default?
however it will still can change dynamically and can not be hard coded.
your response will be highly appreciated!
stalwar1 Please need you help!
Could you explain your business case in a bit more detail? May be with a sample qvw?
May be this:
Data:
LOAD * INLINE [
key, code
1,x
2.y
3,z
];
//Fetch the maximum key value
tmpData:
LOAD Max(key) AS maxkey
Resident Data;
LET vkey = Peek('maxkey', 0, 'tmpData');
DROP Table tmpData;
Regards!
Rahul Pawar
Hi Amalesh,
Do you want vkey to be no lower than 2?
vkey = rangemax(2, max(Key))
try this
Max({1}Key)
or
Max(total Key)
Hi Andrew,
Let me test it then I will let you know.
And, thank you guys for your prompt reply.
Regards,
Amalesh
Hi Andrew,
The vkey value could be less than 2.
I have used a horizontal list box and there are different value available, in the list box 2 will be defult value while I click other options the value will change accordingly.
I can set max value as a defult.
Thanks
Amalesh