Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone.
Need your help,
Is it possible to perform function of variable in scripts to lessen the the use of creating variable.?
Hi Nupur,
What is your exact requirement.?
~Sushil
HI,
iI'm not sure what you're trying to do. Do you mean you want to create the variable in the script?
JAson
Hii shushil,
I want to decrease the use of variables in my dashboards like ,
i am using variable for calculating expression, i want to perform this function during loading of the table in my dashboard
Like i have some fields in a table ,
table 1
Field1 Field2 Field3
A 20 10
B 30 20
C 40 30
D 50 40
My expression is calculated by variable as
sum({<field1={'A'},field2={$var1}>}field3)
where var1=Field2+100/20
I want to perform this function at load time.
Please help.
Hi Nupur,
i did not get the logic of your condition var1=Field2+100/20 since this condition will always be false in the script..
anyways chek the code below .. hope you will get some idea to solve your issue.
source:
LOAD * Inline
[
Field1,Field2,Field3
A,20,10
B,30,20
C,40,30
D,50,40
A,60,50
];
table:
LOAD sum(Field3) as exp,
Field1,
Field2
Resident source
Where Field1='A'
and Field2=(Field2+100)/20;
DROP Table source;
Hii Jason M,
Thanks for reply,
I want to perform calculation during loading of the table without using variable,
How do you know the value of $var1 when executing the script?
Hii shushil,
Yes this is giving me some problem.