Im trying to add a summary row which sum all values in each column. I have very large data and I do pagination in the grid. However, I heard gwt doing summaryGrid in client side which does not work in my case. I tried to setShowGridSummary to true but it works only for a small set of data, it shows blank if the data is large. So I want to change the plan to add additional summary grid and then get the query from backend and insert the summary data into that grid. So my question is can I add additional row into smartgwt grid? And how?
Thanks,
On client side SmartGWT can only calculate summary if you fetched all records so only then summary values will show.
You can disable pagination and do this which I don't recommend for large data sets. Or prepare another data source that can calculate summary on server side and return only one record:
listGrid.setSummaryRowDataSource(summaryRowDataSource);
SmartGWT will make another request to server for summary row with same criteria that was used for normal fetch.
It will be also refetched any time criteria will change.
Related
I’m relatively new to Tableau and have a question.
I want to create a heatmap show the location of two different groups of people. I’ve learned how to overlay maps using dual axis but the problem I keep running into is that each group requires different filters to aggregate the data the way I want.
Basically, I want to show:
Group1.id IF charge_id IS NOT NULL
And
Group2.id IF status = ‘ACTIVE’
Whenever I create a calculated field with one of the above calculated fields and place it in the filters box it automatically removes the other group from the map because the filters contradict one and other.
Help is much appreciated 😊
The filter shelf applies to the entire worksheet, so if you want to “filter” each field selectively, use an IF expression in a calculated field that evaluates to null when you don’t want that field in the view.
Give sample data if you want more detail
In the Project Tracker template there is a feature where statistics for a certain project's items are displayed. You can filter the project items, but the statistics will only show those statistics for all the project items, i.e. the filters do not affect the statistics.
I would like to add the feature of filters affecting those statistics in a similar implementation of mine. My current solution passes the keys of those project items (affected by filters, too) to a calculated data source, which then calculates the statistics using those item keys, essentially applying the filters used in the page.
My issue is that my calculations are restricted by the query page size. For example, if I apply filters that limit the number of items to 15 records, but the page size is 10 records, I will only have statistics of those first 10 items, which is not useful. I'd need to have the statistics on all the records that are left after filtering.
One way to solve this would be to get rid of the query page size and leave it at 0. However, similarly to the Project Tracker template, I'm displaying the project items on the page in a table, and if I do that, the page becomes too heavy.
How can I circumvent the query page size? I'm thinking I could
limit the items displayed in the page by some other way than query page size (i.e. hiding items from the UI)
use a different datasource for the statistics, but in some way copying the filters used in the datasource that is displaying the project items
Both of these ways I could think of, I can't seem to implement. I don't know how I could hide items from the UI to make it less heavy, as query page size pretty much does it. I have also tried copying the filters from a datasource to a similar one, but that does not seem to work.
EDIT: I might have come up with a way to solve this myself, but I still need to implement it. Now I'm using the page size restricted Items Ds to apply the filters on, and the statistics are build from this data source. If instead, I use a non-restricted Ds called AllItems, and apply the filters on it, and then pass the item keys to a page size restricted Ds (to show the items in UI) AND to a calculated Ds (for the stats). Will make a response once I've verified it works.
I solved the issue myself.
To produce (refreshable) statistics subject to filtering but not restricted by page size, I used the following datasource structure:
In this structure, the filters practically flow to the data sources below, as they are passed the ItemKeys that fit the filter. What this completes is that my Statistics (used in piegraphs etc.) can be filtered dynamically and account for all the records that fit the filter, while the UI does not get crowded over too many records, as the data source used in UI has a query page size limitation.
While creating data source in Tableau I want to choose 20 fields out of 100 fields from the table? How to select only 20 fields from the table?
Hide fields you don't want to use. That is the most efficient approach. Tableau will then leave those fields out of the select clause in any queries and exclude those fields from any extracts.
Here is one way to hide fields.
Connect to the data source and stay in the data connection pane
Switch to list view to see the fields listed one per row (for convenience) by clicking the icon to the left of the sort fields switch
Select the fields you don't wish to use, multiple selection is useful here
Right click or use the caret menu (little black triangle) to hide those fields
P.S. Tableau will always leave fields out of the select statement that you don't reference (i.e. don't put on a shelf). So if you are using a live connection instead of an extract, hiding fields can help reduce the number of fields you have to look at on the data pane, but isn't necessary to improve performance. For extracts, hiding fields can reduce the size of the extract and the time to refresh it.
You might think could help performance by writing custom SQL to only request a subset of the columns, but you would most likely be hurting performance instead by defeating the query optimization that Tableau performs.
Introduction: I'm using java, oracle, flex, blazeDS etc. The part of the DB that is relevant to the task i am trying to accomplish is illustrated in the image below:
The Task table will also have a field called enabled , which i forgot in the figure below :) This field is used to enable some of the tasks based on various criteria, when an admin user presses a "Generate task list" button in the GUI.
Based on this generation of the task list, the users in the system should see a grid as the one displayed in the figure below :
This task list should display all the enabled task as illustrated above. The first three columns are retrived from the Task table in the DB, while the next columns(Column_4....Column_N) are generated based on the number of users in the User table. These columns should display the users alias. Each user is part of a UserGroup(Group), which i will model in either a separate table or in the User table itself, as illustrated in figure 1. The Numbers in the grid are based on the Time field in the Task_User table, while the first row below the users shows the sum of the times for each user.
Question: Im still learning Flex, and looking for every help i can get on accomplishing my goal :) I figure i have to implement a datagrid with dynamic columns. But how will the dataprovider work in this scenario? For each enabled taskid the grid has to fill the right user columns with time values. Any tips/help would be much appreciated! It is also important that loading this grid doesnt take to long :)
Is it possible to get horizontal and vertical text in the grid(like shown above)?
One of the reports I am creating has dynamic number of columns - a datatable gets returned from the stored procedure, the number of columns depend on the number of items defined in the database (one column for each item, other than some fixed columns).
Is it possible for me to use RDLC report to generate a report in this case? All the calculations are already done int he report, I am looking at RDLC only for the sake of export to excel/pdf and repeating header/footer.
It is possible, but there is no simple solution. Here is a link to a former answer of mine on this topic.
An additional investigation later
Here is an article describing the mentioned report generation with a self generated RDL object model in detail.
From the sounds of it, you want your report to pivot defined items, which can change with respect to various report criteria. If you know all the columns that COULD come back, you could just define your RDL to bind them all but hide the ones that aren't item defined. You would just have to bind the Visible property of the column to a determination of whether the has been defined.
For your Problem,
I guess you can go for matrix instead of tables.
where you can generate rows and columns dynamically according to the data you are getting.
Check here for using of matrix
Use matrix in RDLC whenever your columns are not fixed in datatable.
Visit http://www.gotreportviewer.com/matrices/
Here you'll find use of both table and matrix in RDLC. See yourself which one suits for your requirement.