Azure Easy Tables - How to load items after 15 - azure

I am looking for solution how to load items from Azure Easy Tables after 15 on each load in Xamarin.Forms app.
I have tried using:
int number = 15;
Client.GetTable<Class>().Take(number);
number = number + 15;
But it also loads previous items.
Thank you !

By default, the backend returns only the first 50 rows. You can increase the number of returned rows by calling the Take method. Use Take along with the Skip method to request a specific "page" of the total dataset returned by the query.
You could refer to the following code to skips the top 15 items and returns the next 15 items.
int number=15;
int number2=15;
Client.GetTable<Class>().Skip(number).Take(number2);
number=number+15;
For more details, you could refer to this article.

Related

setting min and max price from API variable in function

I have an API web http://www.boredapi.com/api/activity/ which randomly creates an activity to do if you are bored. The common output is the activity with the followings fields: key,link,participants,accessibility,price and type.
I'm only interested in showing the activity, the type and the price.
So far so good.
BUT, I wan to be able to get only the activities that are WITHIN a range of prices.
I created the function "fun" and has two parameters (the minimum price and the maximum we are willing to pay.
I want to check in a range from 0 to 10 which activities are available in a specific range of price.
The only thing I can't get around is how to tell the API to print only if the activities are in these ranges...
I tried to access the attribute with ['price'] but it doesn't seem to make any difference.
How would you address this issue?
Currently the output is something like this, the only issue is the price range
import requests
import json
def fun(minprice,maxprice):
for i in range(0,10):
response= requests.get("http://www.boredapi.com/api/activity/")
content_dict=json.loads(response.content)
del(content_dict['key'])
del(content_dict['link'])
del(content_dict['participants'])
del(content_dict['accessibility'])
minprice=content_dict['price']
maxprice=content_dict['price']
print(content_dict)
fun(0,0.1)
Hello from what I understand you are trying to go though each option and check if the price is between two values you can do this by check if the price is between your values like this assuming that content_dict['price'] is a float
if content_dict['price'] > minprice and content_dict['price'] < maxprice:
# whatever you want

SharePoint Search REST API returns inconsistent Total Rows Count

We are a building a custom web part with pagination feature. To implement this feature we are getting a total rows count and showing the possible number of pages.
While implementing this, we are running queries using the startRow and rowLimit query string parameters. When I change the startRow query string parameter, the TotalRows attribute returns a different number for the same queryText.
Example:
https://tenant.sharepoint.com/_api/search/query?querytext='test'&startrow=0&rowLimit=10 returns TotalRows 125
https://tenant.sharepoint.com/_api/search/query?querytext='test'&startrow=10&rowLimit=10 returns TotalRows 112
But the TotalRowsInclusingDuplicates property returns a consistent value. However, If I try to use start row above the TotalRows count it returns 0 results.
I am wondering why Rows Count is varied by StartRow.
Is anyone facing the same issue or have any suggestions?
The same happens in a browser search. At the bottom of the first page of results you might see 746, on the next page 698 and next 752. They are all estimates. They generally get closer to the correct value as you approach the last page of results.
i.e. SharePoint does not even try to guess the number of search pages.
This is from my SharePoint Search course...
For those who search how to fix the issue -
Issue is appearing only when duplicate trimming is turned On.
To fix the issue try to turn duplicate trimming Off.
If you use Rest to retrieve search results - Append &trimduplicates=false
In other cases this article may help.

how to do search functionality using rest api flutter

I want to search the products data and show the searched data in the below as list up to 15 items if 16 item is entered than automatically the first item will be deleted.can any one help me how to do this in flutter
As you written
when we search the item in the search box it will store in the local db
So you can get only first 15 items using the same query. By that using pagination you can show remaining items. I can't get the use case of removing the top item if there are more than n items in list.
But if you want, you can do this by two ways.
First, putting items one by one in the list. Inside this loop if item count is more than 15 after inserting a new item, just remove the first item
list.removeAt(0);
Second, add the items in array, check for length. If length is greater than 15 get the remaining number & run
list.removeRange(0, );
This will remove the items from top

How do I use 3dcart rest API

I need to get the last 10 days orders from 3cart rest API using nodejs. I read the API document but I couldn't figure out how to get the last 10 days orders.
Please give me your suggestions/ideas.
Thanks in advance!
It looks like this is the API call you want, however it does't have a sort or orderby parameter, which means you won't be able to get the last 10 orders.
http://apirest.3dcart.com/Help/Api/GET-3dCartWebAPI-v1-Orders-orderid_invoicenumber_orderstatus_datestart_dateend_limit_offset_countonly_lastupdatestart_lastupdateend
However it does have a count feature, which means there is a way to get the last 10 orders by doing a count of all the rows in the db and skipping them all -10.
example
it counts the orders
[-------------------------] // <-- = 25
the second call we skip the first 15 results and set the limit to 10.
[---------------==========] // <-- we take the last 10 orders
so we want to add the params limit=10,offset=15. The way you offset the results is by doing 25 - 10 or totalCount - 10.

How to get total of top 10 sales in SSRS 2012

I am taking Top 10 of Sales Volume grouped by Product categories in SSRS 2012.
I need the total of these top 10 but it shows the complete total. I cant do it on dataset level as I need the complete dataset for other parts in the report. I tried the solution as given in MSDNlink but that didn't help either. Thanks in advance.
This sort of approach does actually work very well.
You haven't given any idea of what your data/metadata is like, but the concepts can be explained with a simple example. Consider the following data:
We will make a simple report based on this, grouped by the grp column:
Sort the groups by total val, from highest to lowest:
To get the running rank and the running total, we use the RunningValue function.
To get the Group Rank, use:
=RunningValue(Fields!grp.Value, CountDistinct, Nothing)
To get the running total use:
=RunningValue(Fields!val.Value, Sum, Nothing)
Finally, we need to display a total for the Top N values; in this case I'm displaying the top 2.
For the second group detail row, use the following Row Visibility expression:
=IIf(RunningValue(Fields!grp.Value, CountDistinct, Nothing) = 2, false, true)
That is, only display this row when there have been two groups, i.e. top 2. You could change the value as required.
This shows us one total row as required:
You need to apply these concepts to your data. If you're still having issues, I suggest trying to replicate my results with the above data/code to make sure you understand all the concepts involved.
Edit after comment:
For situations where there are fewer than N groups but you still want to display the last total, you need to add an extra check to the Top N row Row Visibility expression, something like:
=IIf(RunningValue(Fields!grp.Value, CountDistinct, Nothing) = 10
or (RunningValue(Fields!grp.Value, CountDistinct, Nothing) = CountDistinct(Fields!grp.Value, "DataSet1") and CountDistinct(Fields!grp.Value, "DataSet1") < 10)
, false
, true)
So now the expression will show the for the 10th row, or if the total number of groups in the DataSet are less than 10, it will show for the last group row.
It's a bit more complicated but it has worked for me in the past; depending on your data and report setup you might need to play around with the Scope a bit to get it working in your environment.
If you just need a total for those top 10 and not a running total, you can filter your table by top N ProductCategory and sort your ProductCategory group by SalesVolume Z to A.
For example, I have a table of sales orders and subtotals. I'm showing the top 10 highest total
I sorted by SalesOrderID group descending by my value (TotalDue). Then I filtered my table so it shows only top 10 SalesOrderID.
If you have a lot of data, you may have to see how this performs since I think the table filter happens at runtime.
I think I found an easy way to do that. I had many "Sums" in my report and I couldn't understand the way you answered.
The way i found was to create a parent group of the Details group and add a total row outside the Details. Then I hided the Detais group and the total group just did the Sums and in the group properties just needed to filter the final Sum top N rows, and sort by Z to A the Sum.
All of this worked fine and was done in the Group Properties! In the tablix poperties only showed 3 or 4 rows...

Resources