Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

Expression to QV

Hi Community,

How to write below expression in qv

(method_original in ('FOU','ADV') and sub_method_original in ('B','C','D') and risk_bucket_original=20,'Strong',

method_original in ('FOU','ADV') and (sub_method_original='SRW' or asset_class_original = 'CLAIM_CIU') and (sub_method_original='SRW' or asset_class_original = 'CLAIM_CIU') and rw_original=2.90 ,'Good') as Credit

1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

if(match(method_original,'FOU','ADV') and match (sub_method_original,'B','C','D') and risk_bucket_original = 20, 'Strong',

if(match(method_original,'FOU','ADV') and (sub_method_original = 'SRW' or asset_class_original = 'CLAIM_CIU') and (sub_method_original='SRW' or asset_class_original = 'CLAIM_CIU') and rw_original=2.90 ,'Good') as Credit

Regards

View solution in original post

7 Replies
martinpohl
Partner - Master
Partner - Master

if(match(method_original,'FOU','ADV') and match (sub_method_original,'B','C','D') and risk_bucket_original = 20, 'Strong',

if(match(method_original,'FOU','ADV') and (sub_method_original = 'SRW' or asset_class_original = 'CLAIM_CIU') and (sub_method_original='SRW' or asset_class_original = 'CLAIM_CIU') and rw_original=2.90 ,'Good') as Credit

Regards

priyarane
Specialist
Specialist
Author

So here Match will do like OR?

martinpohl
Partner - Master
Partner - Master

match is like "in" in your sql statement

priyarane
Specialist
Specialist
Author

Yes.. IN will do OR performance... so here we have used Match so Match also will do OR, am I right..?

martinpohl
Partner - Master
Partner - Master

yes, then it is an or

Anonymous
Not applicable

Yes. QlikView's "Match" is the equivalent of SQL's "in", and will give you boolean TRUE for each of the values specified as arguments in the "Match"-function.

E.g. QV's Match(method_original,'FOU','ADV') gives the same as SQL's Where method_original = 'FOU' OR method_original = 'ADV', which gives the same as SQL's method_original in ('FOU', 'ADV').

shelvinpatel
Contributor III
Contributor III

Hi Priya,

It’s subjective of individual’s interpretation and understanding but there is always an explanation for each method otherwise no need of a separate function.

As Martin mentioned that ‘Match’ is like ‘in’ in SQL and you could use ‘OR’ in SQL instead but it won’t be as efficient (always!).

Thanks, Shelvin