Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
1. what is the correct syntax to define a variable in an expression?
Example in Javascript Style:
varFirstname = GetFieldSelections ([First name]);
alert varFirstname;
What is the "Syntax Translation" for this code?
2. How must i write it, if i want to save a special value, like this:
varYear2016 = {<Year = {"2016"}>} priceYear, salesYear
I want to combine the values in one variable. I want to use it in an expression for a select field. If i select 2016 it should take the values from two fields.
Thats a post Re: One field selection should get two different values about it.
regards,
Fritz
You can not define a variable in an expression.
If you want to "create" a variable, either use the Variable Overview (found under settings) or create and fill it in your script by using the SET or LET statement.
But the question is... What are you trying to achieve? Can you give us an example with some demo data?
Hi Fritz,
The link to the post which have provided will help you understand variables and its usage in Qlik thoroughly.
Thanks,
Sangram
Hi,
ok, how can i get that if 1 show salesYear where is it 2016 and if 2 show salesYear is it 2015?
$(=Pick(Match($(varYear),1,2),'salesYear=2016','salesYear=2015'))
regards,
Fritz