Hi everyone! :wave: Does anyone knows of any equiv...
# gooddata-platform
d
Hi everyone! ðŸ‘‹ Does anyone knows of any equivalent to Vlookp in gooddata? I'm trying to count the duplicate values from two different metrics?
b
Hello, depending on what exactly you need to do, using LIKE/ILIKE clause might be the way for you. But the metrics usually return number, so I am not sure if that will help here.
d
@Boris Thanks for your suggestion - unfortunately this won't work as I'm trying to count the primary key values that match from the two metrics instead of matching patterns within the string values.
b
Hi @Diana Tiganeva, could you provide some very simplified example scenario so I have a better idea what you are after?
d
I'm trying to count # of eligible employees. - an employee can work in many locations, some of which are eligible others are not: 1. eligible locations have a 'job code exclusion' = FALSE and the 2. non-eligible locations have a 'job code exclusion' = TRUE Ð¢here are might be two scenarios in which an employee is not eligible: 1. he/she works in one location where job code exclusion = true 2.he/she works in more than one location - one location is job code exclusion = true and the other is with job code exclusion = false.(in such cases we count them as not eligible) For this second scenario I need to first build two separate metrics 1. count all employees with values = FALSE 2. all employees with values = TRUE and then find all values that match from both metrics, in order to exclude those not eligible . Does this make sense at all?
b
I think I understand. It should be possible to get the result you need. We support IF or CASE statements in the MAQL. So instead of vlookup, you can use multiplication â€¢ SELECT IF value=false THEN 1 ELSE 0 â€¢ SELECT IF value=true THEN 0 ELSE -1 â€¢ SELECT SUM(metric1*metric2) based on the result - positive/negative/0 - you would see if the employee matches both metric.