We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Avoid unwanted aggregation

Answered
Albert Beermann asked on October 26, 2022

Hello Everybody
We don't program special reports!
We offer our users a bulk of data depending on their permissions. (Complex queries from tables and views)
Then they can build their own grids/reports/pivots/flats/... with flexmonster ,for whatever reason, and finaly name and save them for later usage!
There are a lot of things they love do do with your tool, but there are also unwanted behaviors they struggle with.
One main point is, that your interpret every data column with a number as numerical!
In our query results, which we put into flexmonster, there are tons of text/char columns with numbers
(zip code, company number, employee numbers,invoice number,customerid,...) Some of them even with leading zeros!
Now flexmonster by default, always does some aggregation with these text columns!
And in some situations you can't get rid of them. Flat with show totals. sum(price) = ok sum(invoiceno) = stupid
And then we lose leading zeros.
You can laborious change some things with the UI , but when going to details (drill down) you lose some of your changes!!!???
We would like the possibility to set a flag. Don't aggreate text or char fields!
(maybe count() could by ok, but sum, avarage never make sence)
Or a simple way to disable unwanted aggregations in the user interface!
(working with all formats:flat classic,compact and in the detail view, just click on text columns to disable aggeration)
Or ...???
And of course we need our leading zeros 🙂
Any help welcomed
Best regards
Albert
 

4 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster October 27, 2022

Hello, Albert,

Thank you for contacting us and for the detailed description of your use case.

Kindly note that it is possible for Flexmonster to define numeric values as numbers by default. 
In such cases, component behavior requires defining the type of the fields. The proper way to define the field's data type is by mapping. For example,

mapping: {
"Order ID": {
          type: "string",
    },
}

You are welcome to check the following JSFiddle for reference: https://jsfiddle.net/flexmonster/sjxnqgw2/ 

Please let us know if it works for you. Feel free to contact us if other questions arise.

Kind regards,
Nadia

Public
Albert Beermann October 28, 2022

Hello Nadia
Yes, as a programmer i can do all this stuff! But we have decided to invest no time into 'report-programming'  
So we use flexmonster in a different way. We use flexmonster like a powerfull report generator!
We just offer a query generator to our users, so that they can 'Select' whatever they want from our database tables. We don't know which columns from which tables they chose.
The only thing that we do afterwards is, that we put the query result into a json object and pass it to flexmonster. Then the users do everything with the flexmonster-ui.
So they need an possibility to switch to 'STRING', keep leading zeros, switch auto-aggregation on or off,...
We would appreciate it very much, that some things the users struggle with every day , could be done with the user interface.
Best regards
Albert

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster October 28, 2022

Hello, Albert,

Thank you for the detailed explanation.

It gives us a much better understanding of your use case. Kindly note that Flexmonster is intended to receive the data and the data types before loading them into the component. So there's no option for changing data types in the runtime. 
However, such a case can be resolved by considering loading Mapping in the JSON object with the data. For instance, it is possible to get the data types from the database if they are defined correctly (e.g., the zip code is a string value, not numeric).
Alternatively, if there's a limited number of such fields, you can add all the necessary fields and their correct types, so there's no need to get them from your database.

Please let us know if the above solutions help. You are welcome to reach out to us in case further questions arise.

Kind regards,
Nadia 

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster November 3, 2022

Hello, Albert,

Hope you are doing well.

We were wondering if you had a chance to test a suggested approach. Is there still anything we can help you with?

Looking forward to hearing from you.

Kind regards,
Nadia

Please login or Register to Submit Answer