Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
anagharao
Creator II
Creator II

Find values according to conditions in a different column

Hi All,

I would like to automate the process of checking values against conditions. I have a set of values and conditions on them in two separate tables(Data and Rule in the attached). The conditions check if the columns are blank, zero... (the attached has a subset of the rules).

I would like to arrive at a result of the rule for every row in the data set according to the rule id in that row.

Result should be :

  

ABRule IDRule Result
001yes
002yes
011yes
012no
101no
102yes
111no
112no

Please do help me out with this,

13 Replies
Anil_Babu_Samineni

How you are getting Yes and No. Would you please release clue

This

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable

use a staright table with Dimension A,B, RUle ID and

Expression:

=If ([Rule ID]=1, if (A = 0, 'yes', 'no'), 
if ([Rule ID]=2, if (B = 0, 'yes', 'no')))

Result:

anagharao
Creator II
Creator II
Author

Thank you for the reply, but this is a lengthy process when many rules are involved.

Please help me in adding this condition as a column in script.

anagharao
Creator II
Creator II
Author

The yes and no is in the condition itself. When checking the condition is A zero we check A and say yes if zero.

Anil_Babu_Samineni

Still confusing what are you expecting. Does Attachment is working or not as you expected.

Or you are looking

Ad-Hoc Reports: Adhoc reporting in Qlikview

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
anagharao
Creator II
Creator II
Author

something like the attached.

please let me know if there is any other better way?

effinty2112
Master
Master

Hi Anagha,

                         Your logic seems to boils down to

Rule Result = Rule1*(1-A) + Rule2*(1-B)

Rule Result =  Pick(RuleID,1-A,1-B)  EDIT

returning 0 for no and 1 for yes.

Cheers

Andrew

anagharao
Creator II
Creator II
Author

Thank you for the reply, but these are just dummy values.. there might be values other than 1,0 and also conditions checking dates and strings.

effinty2112
Master
Master

Something like ...

Rule Result =  Pick(RuleID, Rule1, Rule2, ...)


Rule1, Rule2, ... will replaced by your rule definition for the corresponding RuleID.