Display very large data on C1FlexPivotPage - vb.net

Example of C1FlexPivotPage
I have a very large dataset (4 million rows) which is extracted through a SQL query. I need to show data in a grid, which is part of C1FlexPivotPage, but it takes so long to calculate and display results. This data needs to be custom formatted like pivot tables, filters, and aggregate functions.
So my question is, what is the best practice for speeding up the process of creating these custom reports, such as the Excel pivot table part, which immediately updates the grid view?
Thanks for any advice.

Related

Static Values from Multiple Queries/Datasets in Single SSRS Tablix

ok so I have this report I have to write in SSRS with a very specific format. It looks like the screenshot below at the bottom. Ignore the arrows and colors. It's pulling from an Oracle database. Each number value cell in this table/matrix has a different sql query to pull it in because they come from different tables, etc.
the top half of the numbers in the table are each from a query. the bottom half of the table is all calculations from the numbers in the top half. I already have the queries for the top half and was trying to figure out how I could just use those to make this table in SSRS with just those and then creating calculations in the bottom half for the report. I can't use a table or a matrix because each query is a different dataset and you can only have one dataset per tablix.
I was thinking maybe doing textboxes and drawing the grid manually, which would be a huge pain. I get errors about not having an aggregate and being out of scope or something and haven't figured out the reason for this yet as it is not my ideal solution.
My current solultion that will eventually get me there is unioning every single query and then creating columns with static values for the rows and columns in the grid and turning it into a matrix. Problem with this is it continues to increase in complexity as I create each further down the table calculation, and the code becomes larger and larger, and takes a long time to create, and I have to do like 6 reports similar in nature to the format of this one. Will probably be a thousand lines of sql and force me to have to make a stored proc because of the ssrs character limitation.;
So my question in a more simple way is, how can I take multiple sql queries that return a static value and make them a single value in a tablix that doesn't repeat, then create more blank rows in that tablix that are calculations of other cells values, i.e. Textbox1 - textbox2, textbox3/textbox4 ?
I got it figured out using expressions with multiple datasets. The answer seemed too easy once I found it. Basically just created a table tablix using my first dataset. Created more detail rows with insert row inside group below. Then I went to the expression builder for each one and found the other dataset and double clicked it to get the expression to pull from the other dataset. For example the bac_labor dataset value would look like this. =Sum(Fields!BAC_LABOR.Value, "BAC_Labor")
Then for calculations can use either same thing like =Sum(Fields!BAC_LABOR.Value, "BAC_Labor") + Sum(Fields!BAC_LABOR_OVERHEAD.Value, "BAC_Labor") or could do something like this =ReportItems!Textbox2.Value - ReportItems!Textbox1.Value to reference a cell value. This saves a ton of time, development effort, and reduction of code for calculations, compared to adding together 500 character select statements to make calculations. Also no need to use stored procs and union or join every select statement together with this method.

SSRS Matrix (pivot) report is very slow

I have a view that quickly returns 28000 rows of data within 3 seconds. However, when I use this view to create SSRS Matrix (pivot) report, it takes almost 2 minutes to run.
More detail about the view:
Gets data from a linked server
Only about 10 columns with date field and amounts (Date field is what I use pivot on in SSRS to get Amount total)
What I have tried so far:
Dumped view into a temp table
Added OPTION (RECOMPILE);
The report is very simple. Without any parameters. This is one of those reports that users can run and do a data dump into excel before importing it into another system.
Any suggestions?
I would look into doing as much of the aggregation as you can on the server, if that's what's taking the time, especially as it sounds like a relatively static report. Give the data to SSRS in a state where it has to do as little work as possible.
If your query then takes up to two minutes to run on SQL Server, you could look into performance tuning, indexing, etc.

Rotating a table object

For the sake of clarity, I'm not looking for the transpose function, like has been asked previously on this site quite a few times.
The excel table object (Insert>Table) is exactly what I want. All I'd like to do is rotate the table for readability purposes. Currently, I have far more columns than rows, and it would improve readability a lot if the axes were flipped so that the vertical aspect of the scroll wheel could be used while looking at the data
My current data is a list of machining jobs. Each row is one job for one customer, and each column is a different parameter corresponding to settings/cost/material. With the tables, I'm able to dynamically sort the jobs in the table based on each of the parameters in a very helpful manner. This is the most important thing: to continue being able to dynamically sort based on the parameters. So far, I have been unable to find a way to transfer dynamic sorting to row headings instead of column headings.

Summing different parts of a column in SQL

I have a database extract in excel and want to create a custom value in Tablue using their create calculation, which I believe is SQL based.
Basically I have a large number of feeds which all show up different amounts in a column. For example:
feed 1
feed 1
feed 2
feed 3
feed 4
feed 4
feed 4
And I want to have a sum for feed 1, feed 2, and feed 4. But in my actual DB there's about 100 feeds all with different number of appearances. I'm having troubles finding a good way to do this. If there even is one. Any help or direction would be appreciated!
I'm assuming that your list is a single column and you need a count of the number of occurrences of each feed. For the sake of example, since a column or table names were not supplied, let's call them colname and tablename.
select colname, count(*) as Ct from tablename group by colname
It would be easier to give an exact answer if you posted a small simplified subset of your spreadsheet. But assuming you have a column called "feed_name" which takes on values like "feed 1", "feed 2" etc depending on the row. Then the feed_name column should be a discrete dimension in Tableau.
Then just put the feed_name pill on a shelf, say the row shelf. And put the "Number of Records" field on another shelf, say the column shelf.
You don't need to write SQL to do this (or most tasks) in Tableau. It helps to understand SQL concepts and its very helpful to drop down to the SQL level when needed to solve tricky issues. But for most situations, you can just interactively explore the data by moving fields around and writing some simple calculations -- and let Tableau take care of generating the SQL necessary to retrieve the data needed to build the visualization you requested.
Tableau supports SQL and some NO-SQL data sources, along with some cubes too. It does that quite well and in multiple ways. You just can work more quickly and efficiently by using Tableau's visual based manipulations in most cases, and then drop to the lower level detail when needed. It just takes getting used to how Tableau operates.

How do you do a crosstab query in Access with a fixed amount of columns

I want to pull data with an MS Access crosstab query so I can bind it to a report. When I load the page I get a Run-time error'3637': Cannot use the crosstab of a non-fixed column as a subquery.
I would like a way to get back a fixed grid when I run the query and if the cell is null display a zero.
Subquery? That's one of my weaknesses when it comes to Access so I can't help you there. I'd suggest posting the SQL of the query though so others can take a look. Also what happens when you run the query?
The following is a query that I'm using to give me costs for the last ten years for a given unit.
TRANSFORM Sum(ServiceRecords.srTotalCost) AS AnnualCost
SELECT ServiceRecords.srEquipmentID
FROM ServiceRecords
GROUP BY ServiceRecords.srEquipmentID
PIVOT "C" & DateDiff("yyyy",[srServiceDate],Date()) In ("C9","C8","C7","C6","C5","C4","C3","C2","C1","C0");
The trick is after the PIVOT. As I want the last ten years worth of data the "C" & DateDiff portion sets up a string variable call C0 to C9. The portion after the In tells which column to stuff things into.
Another query which pulls in data about the Equipment calls this query. The term we generally use for such is stacked queries.
If this isn't enough to get you going please indicate what type of data you are trying to create a cross tab.
Fellow Access MVP, Allen Browne has a good page on this topic. Crosstab query techniques