Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have two fields, Environment and Status. Each Environment can be in any Status.
I created the following variable: = If(match(Environment,'Production') and match(Status ,'active'), 'true' , 'false')
to be able to select those combinations, where it is Production-active.
While this part of the variable works fine (the 'true' option), the opposite selection doesn't work (the 'false' part). When I select 'false' , QV shows still everything (= Total number not changing).
Any idea what is going wrong?
Can you please post your sample QVW?
In your script you can also use like below.
If (Environment='Production' and Status = 'active',1,0) as ProdStsFlag
Then in the UI you can use this flag field.
Hi,
don't know how to select a variable.
Can you explain that ?
RR
yes, I am selecting =$(vProdActive) in a listbox object
sorry, can't share my QVW for two reasons a) size b) confidential company data
but the code you suggested shows same result and behaviour as the one I posted
Try like these
= If(match(Environment,'Production') , True(),flase()) and if(match (Staus,'active') ,True(),flase())
Ok,
I understand.
This way using a "logical" variable won't work as you expect it. It is working correct (as designed) from the view of Qlikview. Play a little bit with my exam app. You will get always all Environment-Value selected in case of false().
I suggest to create a flag as Sudeep posted above.
RR
I guess I sort of found the solution . In the load script I concatenate the two fields to a new one.
e.g. Environment&Status_Name as CI_Env_Stat .
Now I can filter CI_Env_Stat for 'Productionactive' and create a variable that also checks for anything that is not 'Productionactive'
if your variable (vProdActive ) is defined as
= If(match(Environment,'Production') and match(Status ,'active'), 'true' , 'false')
then, you should be selecting vProdActive and not $(vProdActive).
vProdActive returns the strings (true or false) depending on the selection you make.
$(vProdActive) is evaluating what vProdActive is returning which in this case is a string.