xe:viewJsonService only returns 10 rows - xpages

I'm using the viewJsonService to retrieve rows from a Notes view, but only ever get the first 10 rows returned. I haven't specified a value for "searchMaxDocs", but even if I put in a value greater than 10, I still only get the first 10 rows of the view returned.
<xe:restService id="restServiceEvents" pathInfo="getEvents">
<xe:this.service>
<xe:viewJsonService defaultColumns="true"
viewName="vwEvents" var="eventRow">
</xe:viewJsonService>
</xe:this.service>
</xe:restService>
Is this limit defined somewhere else? How can I retrieve all rows from the view?

Set property count to "100000". It will deliver all documents, at least first 100000.
<xe:viewJsonService defaultColumns="true"
viewName="vwEvents" var="eventRow" count="100000">
</xe:viewJsonService>

Related

Determine Size Of Array of Equal Items Excel

I have an array that looks like this
11100100110
essentially, an array of fixed size with each item being a 1 or 0 with the last item always equal to 0.
Consider each set of consecutive 1's to be a "bucket". I'd like a formula to determine the size of each bucket. So the output of this formula for the above sequence should be
312
as an array. Ideally this works in both excel and google sheets.
If you are interested this is the result of a list of stars and bars configurations where the 0's in my sequence represent bars and the 1's represent stars (the final value is a dummy 0 to make things easier to work with). I want the size of each non-empty bucket in a given configuration of stars and bars.
Thanks, in advance.
You could also use the standard method with Frequency which will work with Excel 365 and GS:
=FILTER(FREQUENCY(IF(A1:A11=1,ROW(A1:A11)),IF(A1:A11=0,ROW(A1:A11))),FREQUENCY(IF(A1:A11=1,ROW(A1:A11)),IF(A1:A11=0,ROW(A1:A11))))
try:
=INDEX((JOIN(, LEN(SPLIT(A1, 0)))))
update:
=INDEX(IFERROR(1/(1/SUBSTITUTE(FLATTEN(QUERY(TRANSPOSE(IFERROR(1/(1/
LEN(SPLIT(SUBSTITUTE(FLATTEN(QUERY(
TRANSPOSE(A1:K),, 9^9)), " ", ), 0))))),, 9^9)), " ", ))))
Assuming A2:A9 contains the data,
=ARRAYFORMULA(QUERY(FREQUENCY(IF(A2:A9,ROW(A2:A9)),IF(NOT(A2:A9),ROW(A2:A9))),"where Col1>0",))
FREQUENCY(data,classes) to get the frequency of data in classes
Make sequence of row numbers as data, if 1
Make sequence of row numbers as classes, if not 1
QUERY to get rid of zeros

Get top(N) or single value using Bql

How is it possible to use a PXSelect statement so that it retrieves the Top(N) or the first value for a particular DAC.
Let's say that I have a table with a sequence number and I want to obtain the record with the largest sequence number. How can I do that?
Of course, I would like that for performance reasons, SQL just sends 1 record.
You can use SelectWindowed in place of Select on your PXSelect to get the top N records. In the example below it will get the Top 1. If you change the totalRows value of 1 to 5 it would get the top 5 (except you would have to loop or get the PXResultSet to use all 5 records retrieved.)
Top 1 Example:
DiscountSequence firstRow = PXSelect<DiscountSequence,
Where<DiscountSequence.discountID, Equal<Required<DiscountSequence.discountID>>>
>.SelectWindowed(this, 0, 1, someDiscountID);
Top 5 Example:
foreach (DiscountSequence row in PXSelect<DiscountSequence,
Where<DiscountSequence.discountID, Equal<Required<DiscountSequence.discountID>>>
>.SelectWindowed(this, 0, 5, someDiscountID))
{
//5 rows returned
}

Excel: Countifs on Multiple Columns and Only on Visible Rows (Filtering)

I've seen several forum posts with the answer to this question, but I can't really understand how it's supposed to work, so I figured I'd come here for an explanation.
I have three columns:
CITY........|.Attribute 1.|.Attribute 2.|
Chicago..|........1........|........1........|
Chicago..|........1........|..................|
Boston....|........1........|........1........|
Chicago..|..................|..................|
Boston....|..................|..................|
Boston....|..................|........1........|
Chicago..|........1........|........1........|
Chicago..|........1........|........1........|
I want to get a count of the number of times a city has a "1" in Attribute 1 and Attribute 2. Normally, you would use COUNTIFS (=COUNTIFS(B2:B9,"1",C2:C9,"1"))which would give you the value of 4 - Rows 2, 4, 8, and 9.
But I want to be able to filter this list on the fly, and only be able to see data for Chicago rows, for instance. And thus, want to see the value of 3 - Rows 2, 8, and 9. But when the data is filtered, I still get the value of 4.
What code do I need to insert into my cell to get the value of 3 after filtering my list to only show Chicago, if I want to see when a city has a "1" in both Attribute 1 and Attribute 2?
Thanks!
Would this not work for Chicago?:
=COUNTIFS(A2:A9, "Chicago", B2:B9,"1", C2:C9, "1")
This would not require you to filter the data.
A variant of this could be used:
SUMPRODUCT((Attribute 1.=Satisfactory)*(SUBTOTAL(103,OFFSET(AW3,ROW(tblStudentProgress[D3 Activity])-MIN(ROW(tblStudentProgress[D3 Activity])),0))))
You could also create a helper column and sum attributes 1 and 2. If your helper column row equals 2 then you know both attributes exist. You could take this one step further and use concatenate to combine "Chicago" and your sum. And then filter by Chicago2.

Hide a column of a specific Row-Grouped Table in RDLC

I have a matrix which contains a rowgroup and groups my products based on the Category. I have three categories: Laptops, Tablets, Televisions. My first two categories contain columns i.e. RAM which I don't want to display for the Televisions. Each category is separated by a page break.
I'm trying to hide the column 'RAM' if the Category name is 'Televisions' but only for the specific page
My structure:
[Categories]
[ProductID] [Processor] [RAM] [Colour] [etc]
Desired result:
[Laptop]
[125] [Intel Pentium] [250 MB RAM] [Black] [etc]
Desired result:
[Television]
[126] [Ix TV processor] [White] [etc]
Current result:
[Television]
[126] [Intel Pentium] [need to hide this] [White] [etc]
It is possible to do. The reason you're having trouble with it is because the matrix column falls outside of the category row-grouping scope. To hide the entire column, you have to move the category group above it. The easiest way to do that is to nest your matrix inside of a list control. Put your Category grouping/page breaks at the List level, and then set your RAM column of the matrix (which is now entirely inside of the category grouping scope since it is inside the list control) visibility based on the value of the Category as follows:
=Iif(Fields!Category.Value = "Televisions",True,False)

Javafx TableView formatting

My fxml file has the following declaration:
< TableView fx:id="myTable" prefHeight="756.0" prefWidth="472.0" />
then in Java code, I add the columns and then setItems as usual. This works as expected.
The only other code which affects the table is:
myTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
which nicely automatically re-sizes the columns. But I can't figure out how to do the following:
When I add say 1 or 10 items to the table, those appear as expected in the first 1 or 10 rows of the table, but the number of rows in the table are always 21. Rest of the rows are just empty. I want the table to have only 1 row if I set 1 item or 10 rows if I set 10 items. How do I achieve this ?
All the columns are of the same size. I can manually re-size them, but I want columns to auto-fit according to their size. For example if I have 2 columns one with integer from 1-10 and another with text description, they both have equal size. How do I tell it to autofit the column size according the the row contents ?
Thanks for the response!
The table fills up the layout with empty rows. Try hiding them by adding css
.table-row-cell:empty {
-fx-background-color: -fx-background;
}
.table-row-cell:empty .table-cell {
-fx-border-width: 0px;
}
For #2 you can check the length of text in the cells in the cell value factory but I have title problems like that. You can read the data set and figure out what it should be. These are both approximations depending on font size.
Added this, my play cellValueFactory where I tried out some things.
TableColumn<LineItem,String> amountCol = new TableColumn<>("Amount");
amountCol.setPrefWidth(amountCol.getText().length()*20);
amountCol.setCellValueFactory(new Callback<CellDataFeatures<LineItem, String>, ObservableValue<String>>() {
#Override
public ObservableValue<String> call(CellDataFeatures<LineItem, String> p) {
SimpleStringProperty ssp = new SimpleStringProperty(String.format("%.4f", p.getValue().getAmount()));
amountCol.setPrefWidth(Math.max(amountCol.getPrefWidth(), ssp.get().length()*20));
return ssp;
}
});

Resources