DAX magic or new cube? - dax

Is there a way to check from DAX, which Power BI report a user is opening?
My problem is that I have a model with tables:
-Revenue.
-CostCenter.
I have RLS set up for two special users: I take their USERNAME(), and I give these 2 users access to a specific set of Cost Centers.
Now, I am creating a new PowerBI, I am trying to reutilize the same cube.
But, the access is based on another table named ‘Contract’, so these same two users shall have special access to a set of contracts.
Can I have a way of using 2 Power BIs, pointing to the same cube, and in one report they shall see CostCenters x,y,z and in the other Contracts a, b, c?
Or is it more convenient to just “copy paste” the entire cube (that is, have 2 different cubes) and do the RLS on each one. (I am also in doubt what is the preferred way in terms of maintenance).

Related

Annotation specs - AutoML (VertexAi)

We're trying to build an imaged based product search for our webshop using the vertex ai image classification model (single label).
Currently we have around 20k products with xx images per product.
So our dataset containing 20k of labels (one for each product - product number), but on import we receive the following error message:
There are too many AnnotationSpecs in the dataset. Up to 5000 AnnotationSpecs are allowed in one Dataset. Check your csv/jsonl format with our public documentation.
Looks like not more than 5000 labels are allowed per Dataset... This quota is not really visible in the documentation - or we didn't find it.
Anyway, any ideas how we can make it work? Does we have to build 5 Datasets with 5 different Endpoints and than query every Enpoint for matching?
You can find those limits in the AutoML quotas and limits documentation.
It is possible to have multiple models for group of products -- Maybe even something like: one initial model to classify the product category (jewery, watches, shoes, toys, etc) and a second step for a specific model (to identify the specific product belong toys, or belong shoes, etc). But to be honest, it seems a bit hard to support - but certainly worth trying.
A second option would be training a custom model where you could do a fine tuning on some larger model (ie. inception, resnet, etc) do know all your 20k+ classes (products). It could add a little bit more work at first, but after established, it will become a single model for inference and re-training would be simpler using MLOps mechanisms (ie. Vertex Pipelines).

DM and hierarchies - dimensions for future use

My very first DM so be gentle..
Modeling a hierarchy with ERD as follows:
Responses are my facts. All the advice I've seen indicates creating a single dimension (say dim_event) and denormalizing event, department and organization into that dimension:
What if I KNOW that there will be future facts/reports that rely on an Organization dimension, or a Department dimension that do not involve this particular fact?
It makes more sense to me (from the OLTP world) to create individual dimensions for the major components and attach them to the fact. That way they could be reused as conformed dimensions.
This way for any updating dimension attributes there would be one dim table; if I had everything denormalized I could have org name in several dimension tables.
--Update--
As requested:
An "event" is an email campaign designed to gather response data from a specific subset of clients. They log in and we ask them a series of questions and score the answers.
The "response" is the set of scores we generate from the event.
So an "event" record may look like this:
name: '2019 test Event'
department: 'finance'
"response" records look something like this:
event: '2019 test Event'
retScore: 2190
balScore: 19.98
If your organization and department are tightly coupled (i.e. department implies organization as well), they should be denormalized and created as a single dimension. If department & organization do not have a hierarchical relationship, they would be separate dimensions.
Your Event would likely be a dim (degenerate) and a fact. The fact would point to the various dimensions that describe the Event and would contain the measures about what happened at the Event (retScore, balScore).
A good way to identify if you're dealing with a dim or a fact is to ask "What do I know before any thing happens?" I expect you'd know which orgs & depts are available. You may even know certain types of recurring events (blood drive, annual fundraiser), which could also be a separate dimension (event type). But you wouldn't have any details about a specific event, HR Fundraiser 2019 (fact), until one is scheduled.
A dimension represents the possibilities, but a fact record indicates something actually happens. My favorite analogy for this is a restaurant menu vs a restaurant order. The items on the menu can be referenced even if they've never been ordered. The menu is the dimension, the order is the fact.
Hope this helps.

How to group common set of tables in Oracle sql developer in one schema user

I want to group certain set of tables in one folder in sql developer. Please suggest me on how to do this.
For examples I have two sets of tables:
Set1:
1. Student
2. Course
3. CourseDesc
4. Faculty
5. City
Set2:
1. Person
2. Bank
3. Account
4. City
Currently I have created two separate schema users and created each set of tables in them. What I would like to do is, instead of creating new users for every set of tables, is their a way to group the tables under one folder in one schema.
Appreciate your valuable inputs.
Dex.
I think that SQL Developer doesn't offer such a feature (unlike TOAD's "Favorites", for example) - at least, I don't know how to do it. A possible workaround is to use prefix for tables that belong to the same set. For example:
STU_STUDENT, STU_COURSE, STU_FACULTY
BNK_PERSON, BNK_BANK, BNK_ACCOUNT
It it probably too late to do it for existing tables, but consider doing it in the future.

Square Connect v1 Item ID Changing Across Locations

I have been writing an Square Connect integration that rests on the fact that an item has one and only one ID, even when it is present in multiple locations. After testing with a subset of products on a separate Square account/App, things were working smoothly. I have now pointed the integration at the "real" Square account/App, using that account's credentials, which contains the same subset of products in addition to many others, and the integration is failing. It seems I have many items that now have a unique ID for each location. This means that a single item has multiple IDs. The item only displays once in the Square dashboard, but there are two unique IDs associated with it. In fact, I have one item that has two IDs, yet those IDs share a single variation ID.
I have also noticed two different formats of IDs, which from my research sounds like a variation due to information created pre- and post- a certain date.
Format 1: XXxXxXXX-xxXX-XxXx-XXX-XXXxxxxxxxXX
Format 2: XXXXXXXXXXXXXXXXXXXXXXXX
I suppose the first question is, is this normal behavior? And if not, any thoughts on what might be causing it and is there a way out of it?
There are some nuances to items with older accounts. Items were originally scoped to a location, which doesn't quite make sense with larger multi-location businesses. Internally we are migrating to a location independent item catalog, which should be invisible to you as an end user (save for the change in formats, like you mentioned) and depending on the date of your account it might have a mix of "old" and "new" item ids. It seems like you have basically a "new" location and an older one.
Basically in our current model you are only guaranteed that items will have unique ids within a location. We are working on new APIs that will allow you to manipulate items across locations more easily.

Cognos Report-need 2nd (Totals) Crosstab that is "aware" (filters) using the current Grouping

I am trying to create a report which groups on a column called "Legal Entity." When the output is directed to Excel, a separate tab will be created for each distinct entity in the query resultset.
For each Excel tab/Legal Entity, there will be two "sections." The first is a repeating section that breaks on a column "Funding Arrangement Type." After all of the Funding Arrangement Types are exhausted, there will be a single "Totals" grid which will summarize the data on the tab for the current Legal Entity. The data will be summarized across all Funding Arrangement Types within the current Legal Entity.
Because the Totals (lower) grid is really just a summarization of the same source query, Query1, I thought that I would also bind the Totals grid to it. However, if I do that, I get a run time error that tells me that I need to establish a Master-Detail relationship (If I decide to use a separate query for the Totals grid, the Totals grid "will not be aware" of the current Legal Entity/tab that must be considered when summarizing.)
Therefore, I continued with my guess at how the Master-Detail relationship should be defined. I made various attempts to link the two grids, including:
On all of the dimension (non-summarized) columns.
On Legal Entity
On Legal Entity and Funding Arrangement Type
Doing so affected previously correct totals reported in the upper cross tab results/
This Master-Detail approach is foreign and as a result I don't understand what it is doing.
I also tried to use a separate query, Query2, for the lower totals grid and adding a filter to filter SQL2 where SQL2. LegalEntity = SQL1.LegalEntity in an effort to get the totals grid to summarize within the current LeglEntity grouping. This resulted in a cross join error.
I’m a real noob with Cognos. Suggestions are welcomed. Thank you!
You can use mouse+scroll wheel to zoom in:
I was able to get it working by binding both grids to a single query and for both grids, establish a Master-Detail Replationship on Legal Entity. Prior to doing that, I added these columns to both grids and hide them, not sure if this was necessary.

Resources