Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Count customers based on multiple variables and dates

Hi. 

 

We have a customer database with 3 million customers. It is structured like this :

 

I am trying to make conditional filters on this data. 

As an example, IF variable V1 AND V2 have a MAX date < MAX date of V4, then DISTINCTCOUNT customer 

 

However, when I need both V1 and V2 to have a MAX date < MAX date of V3 it returns nothing. 

 

I have tried to work around this but no solution so far. Any guidence is greatly apreciated! 

 

Update: If i use OR, it returns values, but if I use AND it returns nothing. Why?

 

Count test = calculate(DISTINCTCOUNT(v_DimCustomerCurrentAnonym[%PersonId_KEY]), OR(v_PersonProfileV[Variabel] = "V1", v_PersonProfileV[Variabel] = "V2"))

 

Christer

 

1 Reply

  • Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.