Custom filtering - silverlight

Please suggest the best way for me. I want to change the default filter's behavior. I want my grid filter to work with all data from DB, not only with displayed data in the grid.
For example:
I have 5 rows in the db-table (1, 2, 3, 4, 5)
In the grid->ItemsSource i bound only 2 records (1 and 2)
when i click to the filter i want to see all records from DB (1, 2, 3, 4, 5) and if i check 4 and 5 for example, grid gets from DB data and display selected in the filter rows (4, 5).
What is the best way for me to solve my tasks?
Thanks

DomainDataSource will perform server-side filtering. Is that what you are looking for?

Related

How do you use ArrayFormula with arrays (after aggregation)?

In my example:
https://docs.google.com/spreadsheets/d/1QQNTw_r9-q-FqVNwUoYklup73niZCFyO0VDUYImP5fo/edit?usp=sharing
I'm using Google Forms as an eBay clone to sell rare items. Each bid is outputted from the form to the "Data" worksheet and then I have ArrayFormulas set up inside the "Processed" worksheet. The idea is that I want to process the bids so that we filter everything except the items with the highest bids. All data should be automatically updated, hence why I want to use ArrayFormulas.
My strategy is that in colum A, I first filter all unique items (=unique(filter(Data!A2:A,Data!A2:A<>""))) and end up with:
Jurassic Park 6-Pog Hologram Set
Princess the Bear TY Beanie Baby
Holographic 1st Ed Charizard
However, then in column B, we have to find the highest bid that corresponds to that unique item, e.g.:
=IF(ISBLANK(A2),,ArrayFormula(MAX(IF(Data!A2:A=A2,Data!B2:B))))
However, I don't want to have A2 be a single cell (A2) but an array (A2:A) so that it doesn't have to be manually copied down the rows. Similarly, I also want columns D and E to be automatic as well. Is there any way to achieve this?
Not sure if it would be considered easier than the previously posted answer, but in case this thread is found in the future, I think that this is a slightly simpler way to solve these kinds of problems:
Try this on a fresh tab in cell A1:
=FILTER(Data!A:D,COUNTIFS(Data!A:A,Data!A:A,Data!B:B,">"&Data!B:B)=0)
I did some research and found an answer very similar to what you were looking for. After rearranging the formula slightly to match your sheet, I was able to get this to work:
=ArrayFormula(vlookup(query({row(Data!A2:A),sort(Data!A2:C)},"select max(Col1) where Col2 <> '' group by Col2 label max(Col1)''",0),{row(Data!A2:A),sort(Data!A2:D)},{2,3,4,5},0))
This formula automatically populates product name, highest bid, username, and timestamp. I ran some tests, adding my own random names and values into the data sheet, and the formula worked great.
Reference: https://webapps.stackexchange.com/a/75637
use:
={A1:D1; SORTN(SORT(A2:D, 1, , 2, ), 9^9, 2, 1, )}
translated:
{A1:D1} - headers
SORT(A2:D, 1, , 2, ) - sort 1st column then 2nd column descending
9^9 - output all possible rows
2 - use 2nd mode of sortn which will group selected column
1 - selected column to be marged based on unique values

Dynamic dropdowns, INDIRECT, multiple rows

So I have this "Google Sheets App" in one row. It has 2 interactive dropdowns (Dropdown B options appear based on Dropdown A), and some fields which change based on the option. I finally got all that to work using ARRAYFORMULA(INDIRECT), VLOOKUP, and so on. And it all works well, for the first row.
However, I need many rows of that, so I select the entire first row, and extend it all the way down. However, now Dropdown B options are based on the Dropdown A option FROM THE FIRST ROW, not the row where I'm picking stuff currently. And I understand that my ARRAYFORMULA(INDIRECT) is linked that way, and I would have to delete the first row if I was going to pick something else from another row. What I want to know is if it's possible to go around that, basically new row = new options, just keep the first row as simple values, don't affect anything else? Or at least somehow export the data from the row with a single click, so I can delete it and start all over again for new data?
This would ideally be done in a click since my boss wants me to make a completely functioning enterprise software in Google Sheets!
Google Sheet:
https://drive.google.com/file/d/1HRZsqKyIxD35dqCmCc75ldbtZeGvimKD/view?usp=sharing
try:
=ARRAYFORMULA(IFNA(
IFERROR(VLOOKUP(D2:D, data!A1:B20, 2, 0),
IFERROR(VLOOKUP(D2:D, data!A21:B42, 2, 0),
IFERROR(VLOOKUP(D2:D, data!A43:B54, 2, 0),
IFERROR(VLOOKUP(D2:D, data!A55:B61, 2, 0),
IFERROR(VLOOKUP(D2:D, data!A62:B94, 2, 0),
IFERROR(VLOOKUP(D2:D, data!A95:B101, 2, 0),
VLOOKUP(D2:D, data!A102:B139, 2, 0)))))))))
H2 would be:
=ARRAYFORMULA(IF(F2:F="",,VALUE(TEXT(G2:G-F2:F, "h:mm:ss"))*24*60*60))
and I2 would be:
=ARRAYFORMULA(IF(E2:E="",,IF(E2:E>40, "Paket unijeti rucno", E2:E*H2)))

Filter function not working well with the highest date in Google Sheets

I want to filtre my data like that:
Of every number in the column A (1 to 5) take the highest date value in column B, and then put the result of each of them in the second table. It works when the dates are in order like the case of the number 1 and 2 (F3:I4), but it is not working with the number 3, because its dates are not in order in column B.
This is the link of my worksheet https://docs.google.com/spreadsheets/d/1YuFoCUBMFo5nqYK20tcVHms2dr84yIsEIH2vhbqrlEQ/edit?usp=sharing.
I made it editable by everyone with the link.
try:
=SORT(SORTN(SORT(A3:D, 2, 0), 9^9, 2, 1, 0))

Dataset from a Dataset in SSRS

I laid out the report, and I do a query that returns 30+ rows for a given period of time. One for each workflow. Now, I want to take that dataset (so the query only runs once) and define 6 datasets from it that filter it based on a single selected row. I will populate 8 boxes on the form for each of those datasets.
It appears that when you create a new dataset, it wants to go back to the datasource and ask you about all the data from that one again.
I was able to create a dataset that is a filtered view of the query and figured I could live with creating 6 datasets that ran the query each time filtering it differently each time. So, I need to do a 'copy' on the dataset and 'paste' it back in as a new dataset that is the same as the other one except with a new name.
I also need to set the default values for the Start/End date to be the 1st of last quarter, and the first day of this quarter. Is there a way to create calculated default values or do I need to do a query to return that?
if you are using table objects to create your report. you could use just 1 data set and add your filters to the table accordingly. just go to tablix properties>> filters tab.
for default values you can create expressions like for the first day of the current quarter:
=switch(DatePart(DateInterval.Quarter,today()) = 1, cstr(year(today))+"-01-01",
DatePart(DateInterval.Quarter,today()) = 2, cstr(year(today))+"-04-01",
DatePart(DateInterval.Quarter,today()) = 3, cstr(year(today))+"-07-01",
DatePart(DateInterval.Quarter,today()) = 4, cstr(year(today))+"-10-01")

OBIEE - Change pivot table row values based on prompt

I currently have a set of 12 pivot tables that I display based on a prompt. So the user simply clicks on a 'View By:' dropdown and chooses which table to view. This was accomplished through simple 'dummy tables' and a presentation variable.
My question: Can I set up a similar prompt to change the row values in my pivot tables?
For example, my row values are currently annual (12, 24, 36, ...). I would like to give the user the option to view the data on a quarterly (3, 6, 9, ...) and monthly (1, 2, 3, ...) basis.
Can I add a second 'View By:' dropdown so the user can select both the table, and row values the table is displayed on?
I'm assuming you have a period dimension, with columns for year, quarter and month. If not, you may be able to use a variant of this.
If so, you can use the index col function. To set this up:
You would have a variable prompt, setting a presentation variable with the options [annual, quarterly, monthly]
In your answer, you would have one period column, changing the column formula to use the indexcol function. It would look something like:
INDEXCOL(CASE '#{myPresentationVariable}' WHEN 'annual' THEN 0 WHEN 'quarterly' THEN 1 WHEN 'monthly' THEN 2 END, period.year, period.quarter, period.month)
I was making this much more difficult than it needed to be. The solution is to create Groups for the different buckets of values I was referencing ((1,2,3,...), (3,6,9,...), (12,24,36,...)). Then simply set the corresponding column filter to Is Prompted and add the newly created Groups as Choices to your prompt's choice list.

Resources