Crossfilter 1.4.8 with more than 32 dimension, group all not removing correctly during filter the 32nd dimension - crossfilter

With crossfilter 1.4.8, i have more than 32 dimension, and group each dimension. At first time, i call
32nd dimension's filterExact and the call other dimension's group all(), the group value is correct. But when I remove filter and call 32nd dimension's filterExact function again, i found that the less than 32nd dimession's group not removing value corrently, but the large than dimession's group removing value corrently.
Here is my demo: Demo URL
Through debugging, it is found that when the onlyExcept function of array.js is called for verification when the value is removed, it always returns false. As shown in the picture:
Am hoping someone can suggest places to inspect either my code or the crossfilter code to find the problem.

Related

What sorting algorithm does dplyr's arrange function use?

I have a dataset where we are bringing in a dataframe of values, and assigning each of the values a number 1-5. We're then sorting these values according to this column using dplyr::arrange.
In looking through the resulting data, it's clear that, aside from being ordered by the numbers in the 1-5 column, the original order the rows came in impacts the final order. However, I can't figure out what's impacting the order of rows within each group.
To this end, I've been trying to find the sorting algorithm that dplyr's arrange function uses - however, I can't find it anywhere here or in the documentation. Any help would be appreciated
The documentation doesn't tell you, and doesn't guarantee that order is preserved within ties. That means you shouldn't assume anything about the behaviour within ties.
All you should assume is that things are ordered as the documentation says they will be. If that is violated, it's a bug. If the documentation doesn't say what will happen, then you should assume that whatever happens today may be different tomorrow.
It's easy enough to make any sort into a stable sort (that maintains the original ordering within ties). Just add an extra column containing the original position, and include it as the final column for breaking ties. For example,
dplyr::arrange(mtcars, carb)
doesn't say anything about the order within rows that have the same value of carb. But
dplyr::arrange(data.frame(i = 1:nrow(mtcars), mtcars), carb, i)[-1]
guarantees that the original order is kept within carb values.
The code shows it eventually calls base::order with the default method, so:
method: the method to be used: partial matches are allowed. The
default (‘"auto"’) implies ‘"radix"’ for short numeric
vectors, integer vectors, logical vectors and factors.
Otherwise, it implies ‘"shell"’. For details of methods
‘"shell"’, ‘"quick"’, and ‘"radix"’, see the help for ‘sort’.
Though, it does pass through vctrs::vec_proxy_order first - not sure it that matters.

PHPexcel formula cell getting overrided instead of replace on filter column

I am using PHPExcel_v1_8, I have implemented formula to some cells like following.
$objPHPExcel->getActiveSheet()->SetCellValue('G4','=SUBTOTAL(2,B6:B'.$row.')');
$objPHPExcel->getActiveSheet()->SetCellValue('H4','=ROUND(SUBTOTAL(9,Q6:Q'.$row.'),2)');
I also tried like
$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(6,4,'=SUBTOTAL(2,B6:B'.$row.')');
Here $row means total number of rows.
But when I filter any column then it append/override value of formula applied cell. Please see following filtered total row.
I want only latest value should in filtered total row means want to replace existing value. Right now, I am getting correct value but why it is overrided? Any suggestions what can be the solution?
You've actually discovered a genuine bug here.
I wasn't aware when I implemented the SUBTOTAL logic in PHPExcel that it only worked with visible rows, and ignored hidden rows. Can you please raise an issue on the github repo
However, reading through the MS Excel docs for SUBTOTAL, a function of 2 or 9 will return the result for all rows in the range (hidden or otherwise) while 102 or 109 will return the result only for visible rows

workfront-api - Custom View

I'm setting up a dashboard in Workfront. I want to create a custom view that I'm calling "Est Variance" which, at the task level, will compare a tasks planned hours to complete (workRequired) with actual hours to complete (actualWorkRequired). In other words, we planned for 10 hours but it took 15, so the value displayed should be +50%.
The calculation is Planned Hours (minus) Actual Hours (divided by) Planned Hours. I came up with the following code for the view:
displayname=Est Variance
linkedname=direct
namekey=Est Variance
querysort=actualWork
shortview=true
textmode=true
valueexpression=ROUND(SUB({actualWorkRequired},{workRequired}))/({workRequired})*100
valuefield=actualWorkRequired
valueformat=compound
viewalias=actualworkrequired
... which returns the correct value, but I'm trying to make the following changes:
CONCAT a "%" after the value
Round to the nearest whole number
Add rules that would display any positive value in red, and any negative value in green.
For tasks returning "0" (planned hours = actual hours), display nothing.
1.) CONCAT a "%" after the value
2.) Round to the nearest whole number
Setting the valueformat=doubleAsPercentRounded will accomplish both, so simplify the valueexpression to be
valueexpression=SUB({actualWorkRequired},{workRequired})/{workRequired}
3.) Add rules that would display any positive value in red, and any negative value in green.
You can use the conditional formatting to color the results depending on their value.
i.e.
styledef.case.0.comparison.icon=false // show the value instead of the icon
styledef.case.0.comparison.leftmethod=Est Variance // column name
styledef.case.0.comparison.lefttext=Est Variance // column name
styledef.case.0.comparison.operator=lt // less than operator
styledef.case.0.comparison.operatortype=double // data type
styledef.case.0.comparison.righttext=0 // target value
styledef.case.0.comparison.trueproperty.0.name=textcolor // tranform on true
styledef.case.0.comparison.trueproperty.0.value=03a219 // green
styledef.case.0.comparison.truetext= // ignore
4.) For tasks returning "0" (planned hours = actual hours), display nothing.
Finally a simple IF statement in the valueexpression can make the value be an empty string when the result is 0
IF(condition, trueStatement, falseStatement)
valueexpression=IF({actualWorkRequired} = {workRequired}, "", SUB({actualWorkRequired},{workRequired})/{workRequired}
Good luck!

filter by variable value in report block

I could find no relevant answers in either StackOverflow or google. Perhaps one of you has the answer. This is a continuation from a previous question...
In Business Objects Webi, I have two variables. One dimension, one measure. My goal is to create a simple pie chart.
Here's the dimension variable titled "EWFMCodeSelect":
`=If([Code]InList("BRK1"; "BRK2"; "BRK3" )) Then"BREAK"
ElseIf([Code]InList("TEAM"; "MTG"; "MTNG"; "PROJ"; "TRNG";"WCGB")) Then "DISC"
ElseIf([Code]InList("LUNCH")) Then "LUNCH"
ElseIf([Code]InList("LATE";"NOSHOW";"UNPAID";"UPVAC")) Then "MISS"
ElseIf([Code]InList("COACH";"VTO")) Then "NEUTR"
ElseIf([Code]InList("VAC";"LOA";"SICKUP";"SICKPL")) Then "NODISC"
ElseIf([Code]InList("PREP")) Then "OTHER"
ElseIf([Code]InList("OVER")) Then "OVER"
Else("SHIFT")`
This is the measure variable titled EWFMPieChart(%):
=[TimeDiff (ToInt)]
/ NoFilter(( Sum([TimeDiff (ToInt)]
ForAll([EWFMCodeSelect])
Where ([EWFMCodeSelect] = "SHIFT")))ForEach())
The previous advice I received was to filter the value "SHIFT" from the report block. I thought this would be a simple affair but it's proving more difficult than anticipated. I tried creating a Report Block filter in the Analysis tab "EWFMCodeSelect Not Equal To SHIFT"
"EWFMCodeSelect Not In List > SHIFT"
but only ended up with a single row, the dimension field empty, the measure field showing #MULTIVALUE. I tried a variety of other combinations but all had the same effect.
I tried a Column filter:
=[EWFMCodeSelect] Where ([EWFMCodeSelect] <> "SHIFT")
but ended up with a single row, the dimension field showing: "BREAKDISCLUNCH..." as the value and the measure, again, showing #MULTIVALUE.
I'm missing some important clue here. Can anyone educate me either why this approach is incorrect and maybe supply me with a direction to achieve my goal?
Thanks,
mfc
I don't have the correct answer but I did solve the problem by cleaning up all of the TEST variables, deleting all unused and unnecessary errata that collected up to this point and re-running the report as a scheduled item. I also cleared the browser cache (never bad advice).
After re-opening the report, I was able to filter the report block without issue.
I guess the answer is "When in doubt and receiving undocumented results, clean up your work-space and try again".

BIRT, How to get Dataset Row Count using Javascript

How can I get Dataset Row Count from Javascript function in BIRT. I tried searching this in BIRT exchange, but the only solution offered there is to have a new dataset getting count of values of required data set. This wont suit my needs.
Is there any way to obtain it using dataset events.
An easy way would be to count dataset items in a report variable.
Declare a new variable in your report outline:
Reset it in beforeOpen script of the dataset (in case this dataset is invoked multiple times during report execution):
vars["items"]=0;
Increment the variable in onFetch script of the dataset:
vars["items"]++;
Use your variable in any expression. For example add a dynamic text element in report's body such:
"Items count="+vars["items"]
Important 1: This approach works if and only if the dataset is bound to at least one report element (a table, chart, data element, etc.). For example, it won't work if the dataset is only invoked to fill a list of selection choices of a report parameter.
Important 2: In the body of the report, this variable can only be used after the first report element using the relevant dataset, otherwise it won't be initialized
Dominique has a great answer; It is not clear to me from your question if this simpler solution might also meet your needs.
In your data set use a computed column with a value of '1', then sum the values.
You can write JS that only adds the value if specific criteria are met.
Or you can use an aggregation on your report to sum the values, which would be after any filters or groups are placed.
There is a simpler way if you use the row number in your tables footer:
In the 'Dynamic Text' element you can select:
Avilable Column Bindings > Table > RowNum
Add 1 as the index starts with 0.
You could also make a variable and then add to that for each row created in a table.
For example, in the Table-Detail script, set an onCreate event to check for a value in each row and if there is one to increase the row count. The following onCreate script would check if the row is empty. If the row is not empty, the script increases the counter and goes to the next row.
var checker = this.getRowData().getExpressionCount();
if( checker > 0 ) vars["Counter"]++;
Then you could add dynamic text after the table with the following expression:
"Row count="+vars["Counter"]

Resources