Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am having 12 variables - var1 , var2 , var3, ... , var12 . I would like to compare these variables like var1 = var2 = var3 = ... = var12 . How can we achieve this in QlikView ? Is there any in-built function ?
Best Regards,
Arun.
Hi,
See attached QVW, there are 2 examples: with If and usin SubStringCount.
The first is a common Sequence IF compare fisrt variable VS the rest of variables.
She Second use a variable with a concatenation of vVar2 to vVar12 then using SubStringCount() Function create a comparission using and if. (If all variables are same than the first variable function return 11).
Best regards and sorry for my English :S
Create another variable in UI by click Ctrl+Alt+V for Variable overview and there create a variable and write the expression for variable.
Hi Anand,
In that case many variables needs to be created. Right ?
Eg:
var1 = 'FY13-Q1'
var2 = 'FY13-Q2'
var3 = 'FY13-Q3'
.
.
var12 = 'FY12-Q1'
I would like to compare all variables like var1 = var2 = var3 = ... = var12 .
Best Regards,
Arun.
Hi,
Why don't use the secuence IF?
Cy
Hi Jordi,
I don't know about Sequence IF. Could you please provide an example ?
Best Regards,
Arun.
Hi Arun, what's the expected output of the comparison?
Hi Chander,
If all values are same then 'Valid'.
If all are different, then 'Invalid'
Jordi's solution comes to my mind as well. Am not aware of a more elegant solution. Try the following
If( v1 = v2 and v2 = v3 and v3 = v4 and v4 = v5 and v5 = v6 and v6=v7 and v7=v8 and v8 = v9 and v9=v10 and v10 = v11 and v11 = v12, 'Valid', 'Not valid')
you will need to use variable or $(variable) depending on how you have defined your variables.
Hi,
See attached QVW, there are 2 examples: with If and usin SubStringCount.
The first is a common Sequence IF compare fisrt variable VS the rest of variables.
She Second use a variable with a concatenation of vVar2 to vVar12 then using SubStringCount() Function create a comparission using and if. (If all variables are same than the first variable function return 11).
Best regards and sorry for my English :S
Oswaldo, the concatenation followed by substringcount alternative was brilliant.