As you can see on this link if the request is with resultsPerPage=n it returns n-1 items
Related
get result
want to result please help this
The missing invoice number in an invoice series should only be displayed till the end.
like this only date value but i want to number value
My understanding of the google sheets filter function is that it should limit the results to an array where the conditions are satisfied but I noticed this oddity:
Here is the sheet: https://docs.google.com/spreadsheets/d/1RL9cE6CYcpdNdkoKJvZc_KJ53d8QrNoMEQe-kH-4lo8/edit?usp=sharing
formula for result 1:
=filter(A2:A,A2:A<=105)
formula for result 2
=filter("x"&A2:A,A2:A<=105)
Question: Why does the 'x' continue down in rows where the condition is not satisfied?
Because empty cells treated as zero 0. You can add an addition condition to FILTER() function to filter values greater than zero 0.
=FILTER("x"&A2:A,A2:A<=105,A2:A>0)
I've seen this issue referred to a few times on here but so far I've not seen any kind of resolution. Am pretty certain this is a bug in the API but any help working around it would be appreciated.
The problem: I'm trying to get all of the items in a playlist by using the v3 playlistItems API call. Sometimes it works exactly as expected, but sometimes it comes back with only a partial result set. When it comes back with a partial / incomplete list, two things are always true:
Only 26 items will be returned. totalResults and resultsPerPage will be correctly set to the full number of items in the playlist, but only 26 items will actually be populated in items []. If a multi-page result set is expected you will receive multiple pages with empty items [] once you get past item # 26.
This incorrect behaviour is an attribute of the list. If a list displays this behaviour it will apparently always display this behaviour. Some lists always work fine, other lists always seem to truncate at 26 items.
The behaviour is completely independent of maxResults, so if you set maxResults=50 and query a playlists with 50 items in it, the results will say totalResults=50 but you will only actually get 26 items populated.
Whatever the underlying reason for this issue, I feel that if totalResults reports a different number to the actual number of results in the result set it's clearly a bug.
I've seen using the iframe API suggested as a possible solution but I need to de-serialise the results on a background thread in Swift so I'd much prefer to use the v3 data API, providing it worked according to the documentation.
I'm including 3 examples below. You can observe the results by pasting the URL into a browser, after substituting the [key] for your API key.
Example 1:
https://www.googleapis.com/youtube/v3/playlistItems?key=[key]&playlistId=RDCLAK5uy_kGA_NH_mqT53XwMP_IHL21Pi_bdYBeG58&maxResults=50&part=snippet
pageInfo:
- totalResults : 50
- resultsPerPage : 50
Items returned, page 0:
- Expected : 50
- Got : 26
Total items returned: 26 / 50
Example 2:
https://www.googleapis.com/youtube/v3/playlistItems?key=[key]&playlistId=RDCLAK5uy_mfdqvCAl8wodlx2P2_Ai2gNkiRDAufkkI&maxResults=50&part=snippet
pageInfo:
- totalResults : 81
- resultsPerPage : 50
Items returned, page 0:
- Expected : 50
- Got : 26
Items returned, page 1:
- Expected : 36
- Got : 0
Total items returned: 26 / 81
Example 3:
https://www.googleapis.com/youtube/v3/playlistItems?key=[key]&playlistId=RDCLAK5uy_nUi8B-S9ckz5feHM7oMGyQQ_eKW2Zl9aE&maxResults=50&part=snippet
pageInfo:
- totalResults : 112
- resultsPerPage : 50
Items returned, page 0:
- Expected : 50
- Got : 26
Items returned, page 1:
- Expected : 50
- Got : 0
Items returned, page 2:
- Expected : 12
- Got : 0
Total items returned: 26 / 112
Thanks in advance for any help you can give me on this.
I am trying to make a sheet to count the number of instances of data and certain responses are going to be grouped together. I am having problems coming up with the three formulas correctly. Here are my best guesses along with some English to help clarify what I am trying to accomplish.
//Count all cells that are Warrior or Paladin [Always returns 1, and not zero]
=COUNTA(FILTER(I:I, OR(I:I="Warrior", I:I="Paladin")))
//Count all cells that are Scholar or White Mage [Always returns 1, and not zero]
=COUNTA(FILTER(I:I, OR(I:I="Scholar", I:I="White Mage")))
//Count all cells that are do not all within the first sets of requirements [Always returns 1, not 2]
=COUNTA(FILTER(I:I, NOT(OR(I:I="Warrior", I:I="Paladin", I:I="Scholar", I:I="White Mage"))))
The two cells are Monk and Summoner. Any help would be appreciated
Edit: Here is a sample spreadsheet.
At least two issues:
OR can't be iterated over an array in an array expression; you will need to use the + operand instead.
FILTER will return #N/A if there is no output, and COUNTA will count this error value as 1. Hence when 0 is expected, you get 1; use IFERROR to account for this.
=COUNTA(IFERROR(FILTER(I:I,(I:I="Warrior")+(I:I="Paladin"))))
=COUNTA(IFERROR(FILTER(I:I,(I:I="Scholar")+(I:I="White Mage"))))
=COUNTA(IFERROR(FILTER(I:I,I:I<>"Warrior",I:I<>"Paladin",I:I<>"Scholar",I:I<>"White Mage")))
Alternatives to the first and third formulae that are more easily extendible:
=COUNTA(IFERROR(FILTER(I:I,MATCH(I:I,{"Warrior";"Paladin"},0))))
=COUNTA(IFERROR(FILTER(I:I,ISERROR(MATCH(I:I,{"Warrior";"Paladin";"Scholar";"White Mage"},0)))))
In a google spreadsheet I have the columns A and B populated with some data, then I have this formula to count the values in A if B=1:
=COUNTA(FILTER(A:A;B:B=1))
Problem is that the formula is counting 1 match even if there is no value matching the criteria.
This is the spreadsheet: https://docs.google.com/spreadsheet/ccc?key=0Ak9RViY8FJE5dF9PN3F2ZVFsenk3TG1LZkZjS0d4MHc#gid=0
Thats because the filter results in Error - showing the count 1 which is error...please try
=COUNTA(IFERROR(FILTER(A1:A3,B1:B3=1),""))
The error is being counted and the other result replaces the error with "" which would also return 1. If you want an empty filter result to return zero simply omit the second argument...
=COUNTA(IFERROR(FILTER(A1:A3,B1:B3=1)))