k2v-academy / K2View-Academy

Other
0 stars 0 forks source link

TDM parameters search - cross param correlation #1074

Closed oGogp2SnAhcX8fABSwQBzbjZe1wt8TouGQVrnkV closed 5 months ago

oGogp2SnAhcX8fABSwQBzbjZe1wt8TouGQVrnkV commented 5 months ago

I'd like to subset based on parameters that correlate to one another

example: All the customers that live in state= AK and residency_time = 10 years

my address table has both these columns:

image

As the param values for each column are saved individually, the subsetting above will return customer 1 and customer 2 although the condition for customer 1 is not met (AK,20).

is there a way to achieve such correlation in subsetting?

eHK5dcC00peRJzSmBkzpRSXRdBTJxvlzYiuW95S commented 5 months ago

Hi.

The parameter's selection returns all root entities with at least one record that matches the parameters. If you ask to get customers whose address is AK and residency time is 10 - it will return all customers with at least one address that matches this search criteria. Since both customers of this example - 1 and 2 - have an address that matches this criteria, they will be brought by this search.

Tali

oGogp2SnAhcX8fABSwQBzbjZe1wt8TouGQVrnkV commented 4 months ago

What should be the best practice to create combination of two (or more) parameters? I need all customers that lived in AK exactly 10 years. customer 1 in the above example does not meet this criteria.

eHK5dcC00peRJzSmBkzpRSXRdBTJxvlzYiuW95S commented 4 months ago

Hi.

As explained in the previous comment, the parameters mechanism will bring all customers with at least one address in AK and at least one address with residency time = 10. It does not "tie" both parameters together.

If you want to "tie" both parameters together - state and residency you can do one of the following:

  1. Add a custom logic that selects customers based on state and residency time.
  2. Add a parameter named state_and_residency_time_range. This parameter will have the concatenation of state and residency time range. For example: "AK;0-10", "AK;10-20" etc.. The user can select the right value.

Note that we plan to improve the parameters' search during the last quarter of 2024. I will add it to the list.

Tali