Use of dynamic MDX Categories in Global Filters in the icCube application (dashboard) - iccube

Situation
I've defined a couple of MDX++ Categories in icCube and I want to use these as Global Filters in the application. An example of a MDX++ Categorie is
create category member [Stats].[Top 100 Leveranciers].[Totaal].[top 100] as
order(TopCount([leverancier].[leverancier].[leverancier],100, [measures].[bedrag]),[measures].[bedrag], bdesc),
add_children=true
If I use this as a Global Filter in the application, all my dashboards are filtered, showing the data for the "Top 100 Leveranciers". Perfect, so far.
Now comes the problem/ question
Some users have a security setting that allows them to see only a subset of the data. The "Top 100 Leveranciers" should therefore be different to them, then to users that can view all the data. But, it is not. The "Top 100 Leveranciers" give exactly the same members for the persons with access to sub-set as to users that can access all.
--> How can I achieve the desired functionality in icCube?
My analysis
This is what I believe is happening 'under-the-hood':
To include a CATEGORY as a global filter option, it has to be defined in the SCHEMA DEFINITION as a SCRIPT. It is only allowed (so far) to have STATIC categories in the script. So I guess I am looking on ways to create CATEGORIES that can be used as global filters, but are DYNAMIC for dashboard users.

Not sure to understand why the Top members are not filtered by the actual user access rights: should be the case. Better to contact icCube support directly.
Here is a quick details about STATIC vs DYNAMIC evaluation of the categories from the online documentation:
STATIC | DYNAMIC : an optional modifier to specify the evaluation context. The default value is DYNAMIC:
in that case, when evaluating the formula the list of members is filtered by the slicer
and/or sub-select content. In STATIC mode, slicer and sub-select are ignored.

Related

Way to store Tags for good Query options?

I have a Collection of Posts and a Collection of Users. Posts have certain attributes which are irrelevant for this, but they also have one attribute called tags right now its an array with certain words.
A User can follow certain Tags so he has a attribute followedTags which is also an Array right now that contains the Tags he follows.
Now one of the use cases for this is a User Feed to Show only Posts with Tags he follows, the Problem is that I only found methods to query this for ONE Attribute at a time(in Arrays). Since I dont wanna run 20 Querys for 1 Feed (For example if the user follows 20 Tags) I thought maybe I could make a smart change in the data modell itself, any suggestions?
Problem is that I only found methods to query this for ONE Attribute at a time(in Arrays)
If you try to chain multiple whereArrayContains() methods, you're most likely getting the following error:
Caused by: java.lang.IllegalArgumentException: Invalid Query. Queries only support having a single array-contains filter.
So unfortunately Firestore can only allow a single call to whereArrayContains() method in query.
Since I dont wanna run 20 Querys for 1 Feed (For example if the user follows 20 Tags)
If you have a reasonable number tags, you can create each tag as a separate property. In this case, it is allowed to call Firestore Query's whereEqualTo() multiple times.
If this is not the case, then you should consider augmenting your database structure to allow a reverse lookup by creating each tag as a seprate object (document) in a tagCollection. Under each document you can create a new collection named tagPost in which you should add all the posts that are labeled with a specific tag.

What is the syntax to add a column to the Custom Form list that shows where in WF it is used?

Super simple.
When viewing the list of Custom Forms in Setup, I want to add a column that shows where those Custom Forms are in use (or null if used nowhere).
This is similar in principle to viewing the list of fields, which has a list of forms on which those fields are used.
What is the syntax I can use to add the appropriate column(s) to the view?
As far as I know, there is no linkage in the backend that connects categories (custom forms) to their host objects. This is probably because the list could be massive and the query would take quite a while to execute as it would have to traverse every object in Workfront or each form would store every parent object ID.
Unfortunately, you can't even search for objects by associated category IDs, so if you wanted to build this yourself you would need to query each object and search its categories to see if your custom form appeared.

Drupal views: list referenced nodes except the one used as contextual filter

i have the following case: I am building a website that has information on filmmakers and their films. I have a node type for the filmmaker, with biographical content, etc and another one for the films, with a field 'author' that references one or more of the filmmakers (since one film may have been made by several of them).
I also have a views block called 'filmography' that lists all the films whose author is the filmmaker (node) the user is seeing. Setting this up with a contextual filter was quite easy.
But now I want to present in this block along with the film name, all the filmmakers that may have made the film ('author' field in the film node) and that are different from the filmmaker being viewed. Displaying all the filmmaker nodes referenced by the author field is immediate, but I want to remove the filmmaker that I am using in the contextual filter. The goal is to get something like this:
Filmmaker 1
Movie 1
Movie 2 (with Filmmaker 2)
Movie 3
I have the notion that this might be done using views php and filtering the node references returned, but I wonder if there is an easier solution for that...
Thanks
Update: I have managed to get a result using the Views Field View module, passing the list of referenced nodes (filmmakers) as a contextual filter (node ID) and then adding another contextual filter (node ID as well) as an exclusion, and getting the default value of the letter from 'node id from URL option' (that is, from filmmaker's page the filmography view is embedded in). Keeping the question open for a while to get other, possibly more efficient, alternatives.
As I read your question, the Views Field View module popped into my mind as the obvious solution (then I saw your edit). I think this will still be your best bet. Definitely avoid using php fields as that is not a good practice in general from a security standpoint. If you are concerned about efficiency/performance, then you should just use views caching setting under the advanced options. Seems like this option is always looked over.
If you are looking for alternative options, one might be to use rendered nodes as your View style instead of fields, then use Display Suite to generate additional display modes beyond "Default" and "Teaser," create a view with the filters, then use the Entity Views Attachment (EVA) module to insert a view as a display mode field. While this is certainly a robust approach, it adds a lot of processing overhead with the rendered entities, so you definitely want to cache the results of that as well.
p.s. You might get faster/more responses over at https://drupal.stackexchange.com/

Drupal: relating two fields with each other

I have two fields: Supervisor and agent in a new content type. The list of agents depends on the supervisor selected. How can I create such a dependency i.e. each time a different supervisor is selected from a list a new list of agents is set?
Do I need to set up the supervisor and the agents each as nodes and then use entity reference?
How can I set up the dependency in the content type?
Cannot ask for clarification since I'm new here but here goes
Taxonomy terms can be a solution to the problem depending on the amount of information Supervisor and agent holds. If they hold information like phonenumbers, adresses, names etc. then they need a content type. If these are in fact references to users in the system then you need to use those users. If it's just for categorization, taxonomy terms will work just fine.
Set up the Supervisor as the parent term and the agents as children. Then use a widget like this one to handle the input: https://drupal.org/project/term_reference_tree
Afterwards you can retrieve and show data based on which term/agent is relevant.

Drupal 7 and Views, contextual filters searching through multiple/combined fields. Is it possible?

I've worked with Drupal 7 and Views for a while now and I'm familiar with what Views allow by default and what is available as modular add-ons. Today I've come across an issue with Contextual filters, which allow you to pass in an argument via the URL and use this to filter the returned data.
Normal filters on the other hand can be exposed as a form and also allow for a field combination module which means we can search field{1,2,3} all at once and display the data depending on this input. (views_combined_fields)
Is it possible to tell Views to show me all rows (WHERE field1="test" OR WHERE field2="test" OR WHERE field3="test") but by default, if I add in multiple contextual filters only one of them is being triggered. In this example the "test" value is obtained from the url /data/test.
My problem is that users have a default group, but they also have the option to be added into other groups which are set in the field{1,2,3} fields. My current view shows all users WHERE group = "test" but I want users who have a secondary or tertiary group of "test" to also be displayed in this list.
As i understood, you are talking about Views Arguments, watch the tutorial video from
MustardSeedMedia.com. And useful video about Views 3 User Interface

Resources