I want to create a custom property that merges the values of two previous properties. For instance, it will merge property A and property B to be the same value, so I can add a filter on the new custom property that matches any of A or B. I donβt want to merge it in the lexicon section so that I can still individually filter on A or B. Please write the formula to do this.
You can achieve this using the if or ifs function in a custom property formula. The idea is to return a single unified value regardless of which property (A or B) is set on the event.
Here's a simple formula using if with the defined function:
if(defined(A), A, B)This returns the value of property A if it exists, otherwise it returns property B. The resulting custom property will reflect whichever of the two is present, allowing you to filter on a single unified property while still being able to filter on A or B individually in other reports.
If both properties can be set simultaneously and you want to handle all cases explicitly, you can use ifs:
ifs(defined(A), A, defined(B), B, TRUE, "not set")This checks for A first, then B, and falls back to "not set" if neither is defined.
Once created, you can apply a filter on this new custom property (e.g., custom_property = "some_value") and it will match events where either A or B equals that value β without touching your Lexicon setup. [Custom Properties]
Note: Custom properties are local to a report by default. To reuse them across reports, click Save when creating the property (available on Growth and Enterprise plans). [Custom Properties]
βΉοΈΒ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
