Acknowledged

Stop automatically adding parenthesis to filter logic in report builder


Userlevel 2
Badge

Recently (possibly with the switch to HA reporting), the report builder has started automatically adding outside parenthesis to filter logic statements. This is unnecessary, and when I need to add specific subclauses I have to go in and clean it up. 

 

Example: A AND B AND C is saved as (A AND B AND C) - the parenthesis don’t serve any purpose. 

I would like to add a D OR E subclause to the logic. So I put the new filters in place, and need to end up with A AND B AND C AND (D OR E). I’ve got to go clean up the automatically-added parenthesis, which never did anything anyway. It would be more convenient if those weren’t added in the first place.


12 replies

Userlevel 7
Badge +1

A and B = (A and B) but the ( ) adds unnecessary characters when trying to make simple changes. For us admins who have been doing this for years at this point and have that muscle memory, throwing in a few more characters impacts our workflows HUGELY. 

Userlevel 7
Badge +2

:100:

Userlevel 4

Hello @TMaier, thank you for posting on Community, looping in our Product Manager to look into this and get back to you. 

Userlevel 7
Badge

good call out @TMaier 

Userlevel 1

I agree seems to be weird once the logic grows big. 

Alternative would be to follow what most IDE’s in the world do put a closing parenthesis once a new one is opened it keeps the subclauses intact and also prevents people from having to remember to close them out .. ? 

Thoughts ? @gunjanm  @bradleymcg @TMaier 

Userlevel 2
Badge

Azad, unless my memory is way off the old system just didn’t automatically add parenthesis at all - it was on the user to define those if they were needed. It seems cleaner and easier to return to that method because the only time parenthesis would be relevant is when a subclause is required and then I’d already be defining it with the required parenthesis.

 

If you were to automatically add parenthesis in any way, the problem you’d face is correctly predicting the user’s intentions which seems tough. Leave that to us.

Userlevel 1

@TMaier  - my suggestion was to only add the closing parenthesis by default when you open one so that it’s easier to know when you form a sub clause 

We would remove the parenthesis that exist today that do not add value .. 

Userlevel 2
Badge

How would you know where to add the closing parenthesis? At the end of the entire statement would be my assumption, but that gets wacky if I edit logic to create subclasses anywhere before the end and close it myself. 

I assume that the automatic addition is only made when the user saves their logic, which means it won't be visible in real-time and I think that would lead to even more confusion.

Userlevel 1

 

 

@TMaier  - Here is the example - There are three  things happening here 

 

  1. There are no unneccessary parenthesis being added 
  2. As soon as you Open a parenthesis the cursor move ahead one step to allow you to start typing in the sub clause space 
  3. A closed parenthesis is also added right after your cursor moves ahead so that you do not have to add one yourself. 
Userlevel 2
Badge

That looks good, except in instances where I am editing existing logic - how would it handle that?

Userlevel 7
Badge +2

@Azad it would probably be better to let the Admin determine the logic rather than have the tool try to make assumptions. Nothing irritates me quite as much as when I am trying to create or modify an asset and it makes an assumption that does not match my intention.

Userlevel 7
Badge

 

 

@TMaier  - Here is the example - There are three  things happening here 

 

  1. There are no unneccessary parenthesis being added 
  2. As soon as you Open a parenthesis the cursor move ahead one step to allow you to start typing in the sub clause space 
  3. A closed parenthesis is also added right after your cursor moves ahead so that you do not have to add one yourself. 

When Gainsight allows us to write actual code, having a plug-in to Atom Text editor would be great as that could to the heavy lifting, and has tons of customization on automatically closing brackets, customizing common things, etc. However, writing out Gainsight logic is a bit fiddley as it is as we’re limited to AND and Or statements in one line, so predictively adding this as @darkknight and @TMaier has pointed out will be an overcomplication that will create more problems than it solves.

 

A simple validation on save noting that a pair isn’t closed is really all that’s needed, which was what we already had. @Azad 

Reply