This will likely become a product idea, but asking nevertheless:
Is there a way to use the DQL function entityName() with a dynamic or without a type?
Imagine the following:

I have a field that contains the entity ID, from which I want to get the entityName. But to get the name via the entityName() function I also need to specify the type of the entity. This parameter has to be a constant string. So even if I can manually determine the entity.type (line 5) I cannot use this as parameter in the function.
Idea: the entityName() function should be able to determine the type of a given entityId by itself (make the type parameter optional. Of course this will only work for built-in entities but not for custom entities, but it would tremendously help for such usecases.
Or is there another convenient solution that does not require lots of "IFs"?
Certified Dynatrace Master, Dynatrace Partner - 360Performance.net