QlikView : get data filtered in pivot table - pivot-table

I found a great tutorial for building a nicer (dynamic) multibox, without extensions.
I was able to use it, and I really love it.
However, I have an issue:
if I use a multibox with a master detail table, then if I filter it from detail then master will automatically selected. The below example shows a normal multibox at the top, and dynamic/pivot multibox at the bottom:
How I can achieve this with my dynamic multibox?
For the label, I use:
=if(IsNull(GetFieldSelections(master)) = -1, 'Master',GetFieldSelections(master))
with this, I can set 'Master' as the label.
I can see data has seen filtered but I didn't find a function to get data that has been filtered to set it in the label, maybe someone here can give me an advice to solve this.

The GetFieldSelections() will only give you the list of explicitly selected items. By selecting items in the detail, you're only selecting from the master implicitly.
Try using Concat() instead. This will give you the list of possible values for a field that isn't being directly selected upon.
Your next big headache will be how to determine when to show 'Master' or not. One possible method is to compare the full list of possible values in Master to the possible list. In the example below, I do this by comparing the possible count of master count(master) with the full list of possible values in master count({1}master).
Combining these, one solution could be:
=if(count(master)=count({1}master),'Master',Concat(master,', '))

Related

Apache Tinkerpop Gremlin Returns Query Results using Select Values As

I have this query that it is working as expected for me.
g.V().or(hasLabel("poi"),hasLabel("business")).as("dest")
.outE().inV().hasLabel("region").as("reg")
.select("dest").values("name").as("dest_name")
.select("dest").values("budget").as("dest_budget")
.select("reg").values("name").as("reg_name")
.select("reg_name","dest_name","dest_budget")
This query yields this result.
As I have expected. However I need to retrieve more properties from the "destination" I need to retrieve more 10 properties. This will me into something like this
g.V().or(hasLabel("poi"),hasLabel("business")).as("dest")
.outE().inV().hasLabel("region").as("reg")
.select("dest").values("name").as("dest_name")
.select("dest").values("budget").as("dest_budget")
.select("dest").values("property3").as("property3")
.select("dest").values("property4").as("property4")
//insert more queries like from the above
.select("reg").values("name").as("reg_name")
.select("reg_name","dest_name","dest_budget","property3","property4")
The query will grow long eventually which I am trying to avoid since I need to select values as well from the region as well. So My initial thought was to use select to select multiple values and label them each with an alias like this
g.V().
or(hasLabel("poi"),hasLabel("business"))
.as("destination")
.outE().inV().as("region")
.select("destination").values("name","budget").as("dest_name","dest_budget")
.select("region").values("name").as("reg_name")
.select("dest_name","reg_name","dest_budget")
However I was surprised with this result. Which I was not expecting.
To my understanding the names in values will be mapped to each values passed in the as step. Am I wrong?
Is there anyway for me to retrieve the result from the first screenshot without writing a long query?
The as() labels the step, not the values within that step. So by doing:
.select("destination").values("name","budget").as("dest_name","dest_budget")
you're just naming the values() step twice. I think that you can drastically simplify this traversal for what you want to get as the result though and it doesn't involve stringing together a lot of select() steps:
g.V().or(hasLabel("poi"),hasLabel("business")).
project('dest_name','dest_budget','reg_name').
by('name').
by('budget').
by(out().hasLabel("region").values('name').fold())
You will get a slightly different structure in that "reg_name" will be a list of all the region names rather than having a flattened structure, but you could unroll that I imagine if needed.

Where does the value of 'Last changed on/by' is stored for any element in 'se11' (Inside attributes tab)

I want to find out 'last changed on/by' for a large number of elements going in 'se11' and checking it's attribute value .
So instead of copying each elements name and checking it's attribute for the same value, is there any table or database in which i can get the values for multiple entries at once?
Picture is attached in the question for the reference.
With the cursor placed in the field you're interested in, press F1, then select the technical info. This will show you the table name or - as in this case - a structure named RSDXX, which is not what you're looking for - but it is the fastest way in some cases.
Alternatively, start transaction ST05, enable the SQL trace and navigate to the display in a separate window. Then stop the trace and examine it - you will find a list of all tables accessed for the process. Very near the top of the trace list, you will find a table named DD02L which is the one you're looking for in this case.

Xtrareport DevExpress Keep Table together with the first record

I have some data that I want to be displayed the following way and I cannot find how to do it:
For example this would be the keep together case:
But I don't like that I have a lot of blank spaces when data is too much, so I would like the following to happen if possible.
When the colNames and the first row can fit in the remaining space put them there.
Or if more can fit after the first row, put all of them there and split where it is possible if necessary.
Basically I want a 'Keep together' option for the columns and first row, and everything else can be splitted at any point.
If anyone wants to achieve the same functionality do the following:
Put the table column names inside a GroupHeader and set its GroupUnion property to WithFirstDetail.
Put the table rows in the Detail next to the GroupHeader.
By doing this the WithFirstDetail property, as the name suggests, will try to keep the header with the first record, or move to the next page. Therefore achieving the behavior described above.

Grouping tablix by Paramater is SSRS (#Error) and automatically adding (0) when selected in expression

I hope this is not a stupid question, but I have searched everywhere and have tried everything.
I have a dashboard and would like to group the tablix (The dashboard is inside the tablix) by one of the Parameters (Consultant). There are a few Data sets(queries) in the report and all of the Parameters are filtered with IN in the where clause.
The problem I have is that when I go to the row group properties and select the Parameter in the expression, then it automatically adds a (0) at the end. If I take the (0) away then I get the error message:
the group expression used in grouping 'Group1' returned a data type
that is not valid
I know the (0) is for getting the first value, but I am using Multi-valued Parameters.
I have tried one thing I found, but unfortunately it didn't work for me (SSRS Group By Parameter).
Edited:
This is to show you that there are multiple Data Sets(Queries) in this report
I have the dashboard in a tablix so that I can group for each Consultant, so when I choose 3 Consultant, I get 3 dashboards.
Expression used:
Then I get this error:
I have also tried using the CStr, but also no luck.
When I add the Parameter in any expression box it automatically put the (0) as below:
But then it doesn't use the parameter as I get an #Error where is should be the Consultant name.
I also used this option for page break but end up with graphs below each other:
This is what happens to the Charts(Sub Reports)
To give you an idea how the dashboard should look for each Consultant.
Regarding the other question I saw. I just tried exactly as they said but also no luck
I hope this isn't too much information. Just trying to help you help me.
Thank you!
UPDATE:
Parameter Properties:
Have you tried using the list tool to separate the sub reports by Consultant? A list acts like a container and will create whatever is inside for your grouping. You should also be able to apply a parameter to the list for filtering.

Report Builder 3.0 Add Data Elements to an Array

I'm currently working on building a dashboard for some hospital metrics. The state requires that we report median key times. This dashboard will need to display the group median time for each day and the total column will need to display the entire dataset's median.
I'm working with Report Builder 3.0 and SQL Server 2014.
I've built a stored procedure that can calculate all these values accurately but accomplishing the mean this way makes expanding the dataset a bit of a monster when a new field needs to be pulled in.
All the articles (like as this one) I've read for calculating median within Report Builder point to needing to display (or insert and hide) all the data from the dataset. This method seems really hacky to me and is going to make this dashboard an absolute monster to try to manage as it grows.
What I need to know is, is there any way to pass the group values to a custom code function? The report has to have access to the group values at some point or else it wouldn't be able to perform the built in aggregate functions (Sum, First, Last, etc) on these groups. If I can't pass these values as an array to a custom code function, does anybody know how the group aggregate functions are built?
Thanks in advance to any who might have a direction to point me.
You can pass the values from the procedure to a function within SSRS and then have it just display the resulting median. I'll just give you summary to get you started.
Create a hidden parameter that allows multiple values.
Set its available values to pull from the dataset that is populated by your stored procedure.
Also set its default value so that all values are selected by default.
Go to the Code section of the report properties to write your function.
The function will take the parameter as an argument like this Public Function MyFunc(ByVal p1 as object()) as Integer
In the function you can refer to p1.Length and an item in the array like so: p1(i)
In the report you can call the function in an expression like this: =Code.MyFunc(Parameters!p1.Value)
Hope this points you in the right direction.

Resources