In my class where I am supposed to count used and modified pages in the given table and the command only gets the page table number as input from the user.
However, I know how to count used and modified pages, but I will need the virtual address which I don't know how to calculate.
Any ideas?
Related
I am creating a Google Data Studio report for a car dealership and I have a problem.
I have made these 3 screenshots to illustrate:
If you see on the first screenshot, the datasource is pretty simple, used/new indicates weather the car being sold is new or used and if it is a sportscar or family car, and exchange/clean deal indicates weather the dealership takes/buys the customers old car in for a trade off in price. The rest should be self explanatory.
On screenshot2-3 you see my report, I have one table for each salesperson and it shows the amount of sales for each combination that has sales.
The problem is this, I want the tables to show each combination even if it does not have any sales at all, it should just show 0 then in record count. Like Mike on the left has more combinations than john, I still want Johns table to show those combinations just with a 0 then, and it should be sorted the same on each table so they look the same, just different data in the cells.
Is this possible to do?
To solve this problem, you need to make a combination of data, from the database with itself. Your main analysis dimension, which will generate your combinations, is used/new and Exchange/Clean deal. So your combination should be:
The filter defined in the second database (right base) must contain a filter telling which person the table will be destined for. So, for each table, you must make a new combination that contains the person-specific filter.
I just took a sample from your original database (10 first lines) and the result is:
I work on a mobile app which shows a stream of data fetched from the server. Initially the app fetches first page with 10 items. When user scrolls down, the app fetches the second page with next 10 items (in other words - infinite scroll). The problem I have is that when the user A fetches page number X it is possible, that the user B creates a new content on the server which modifies the resultset available for the user A. This means that if the user A tries to fetch X+1 page, it will contain previous item(s) which were "pushed back" by the new content. How to solve it? I came out with two solutions but I don't know which is better:
the mobile app remembers ids of already shown items and if in the next page there is an item which was already shown, it is not shown again.
the app remembers date of creation of the first item from the first page. When it fetches next pages, it additionaly sends this date to the server which adds this date to the sql query in order to maintain the same resultset
What do you think? Which is better? Are there better solutions?
UPDATE:
Imagine that I have a table 'queries' with columns 'queries_id' (integer, primary key), 'date_created' (timestamp). My query looks like this: select * from queries order by date_created desc. It is not true that date_created date_created increments with primary key incremenatation. I paginate data with Spring Data using Pageable object. Now the problem is that if new rows are created and they have date_created newer then previous newest row then they modify resultset.
This happens because you do the pagination based only on the date_created.
I assume that you do your query with ORDER BY date_created DESC and you offset for the current page.
To avoid your problem you need to add the last id of the previous fetch in your query. I.e. queries_id < last_id ORDER BY date_created .... etc
I have a Count query that uses multiple criteria to produce a result looking like:
count ID
1 "abc"
4 "bcd"
5 "def"
1 "cde"
This shows how many times the ID appears in a given database. The datasource is through an odbc connection that updates automatically. So the ID values change everytime it is opened. I would like to try to turn the unique ID or the associated count into a hyperlink that when clicked will return all information involved in the count (*note the database has much more information associated with the ID's than is counted, a date range of the previous three months is applied.) Can this be done simply?
Database format:
ID Instance Device DateBeg DateEnd
Thanks in advance,
LP
The short version -
This should be simple to do using a report (but could also be done using a form I will be explaining how to do a report for this version). You would just make a report that includes all of your fields then call the report on click. It is important to mention that you will need to view the query via a form to make this work.
A more detailed version -
The first step will be to make a form based on your query (you will not be able to do this directly from a query). To do this select your query then click on the create tab then click Multiple Items Form. Adjust as needed.
Then create a report that shows ALL of the records how you want it to display. (I will call it rpt_ViewDetails) (we will limit later)
When you are done adjusting click on the field that contains the "abc" etc. results (if this is a calculated field it will be more complicated.) I will call this field "Criteria" for the example. Go to the events tab on the property sheet (in design view). use the On Dbl Click event and go to code builder.
This is what the code would look like (place in between the private sub.... and the end sub lines of code):
DoCmd.OpenReport "frm_ViewDetails", acViewNormal, , "[Criteria] = " & Me.Critera
Let me know if you have any trouble with this, also let me know if the structure is different than I am assuming, I will need a more detailed report of what the query is doing if this is the case, what the structure of the database is etc.
I am using Rbuilder within a application constructed with Delphi. I have a report already built that displays a list of items but then at the bottom I have some subtotal fields as well as a total field. The subtotals and totals are defined as variables which then total up the cost of the individual items.
Unfortunately both the subtotals and totals only give me calculations for items on the first and last pages of data. Lets say there are 5 pages of data that prints out. Page one the totals are accurate.
Page two totals are accurate. Page 3 totals include ONLY the totals from page 1 and page 3. Page 4 total includes page 1 and page 4 and so on. I have been trying to play around with timing settings as well as moving my code calculating the total to different operations (ongettext, onprint, oncalc, etc)
Has anybody ever run into this?
Ok, so I kept working at this and eventually found the problem.
At the report level I changed the report from TwoPass to OnePass. That ended up giving me very close to what I wanted. I ended up having to write some more code to get exactly what I wanted but changing the number of passes worked.
I was trying to display a running total page by page. And as I changed pages it would update the value.
Onepass worked.
I am working jqgrid pagination .And stucked at a very basic problem but it is really irritating me.
There are two main aspects of what i am doing.
1. Server side pagination for server side data.
2. Client side pagination for server side searching
In 1st case i am fetching 50 records for every pager button(next,previous,last,first) and also if user enter page number then also correct service call is fetching perfect 50 records for me and setting data. Also as per my requirements i want jqgrid to show total records on the server at the bottom-right side of grid even if grid contains only 50 at current and accordingly total pages should get updated. this is also working properly.
Actual conflict is here .If i search with some criteria service will return me whole data for search say 300 records. Now all the 300 records are fetched in single service call. So i want client side pagination for this .I am able set 300 records and page number also but view {} to {} and page number in textbox at the center does not get updated.
Is there any way to reset the value of page textbox and view{} to {} to default value ?
Please help
It seems, that you post wrong values in total, page and records of the server response. I suppose that you switched the values of records and total. The value of total should be the total number of pages in the dataset. The value of records should be the number of rows (records, items) in the dataset. You should either adjust your server code of specify jsonReader which get (calculate) in correct way the data total, page and records from the data returned from the server.
I recommend you to read the answer to understand why jqGrid send to the server additional parameters and why the server require to return total, page and records.