Cognos Dashboard: create a query from two data sets - dashboard

This is simple enough to do in a Cognos report, but I want to do it in a Cognos dashboard.
I have data from two data sets, last month and this month, that may look like this:
LastMonth
AccountNum
Balance
1234
$1,000
1230
$1,000
1231
$1,000
1232
$1,000
ThisMonth
AccountNum
Balance
1235
$1,500
1230
$1,000
1231
$1,500
1232
$2,500
I want a visualization (list, table, scorecard, etc.) to present the changes by category. I want to know how much of the total change was attributed to accounts leaving, accounts being created, and how much of it was within ongoing accounts.
Output
Change
New Accounts
$1,500
Closed Accounts
-$1,000
Continuing Accounts
$2,000
Is it possible to do this within the dashboard, or will I need to develop some upstream object (data set or module) to make this happen?

Without knowing the source of the data sets and their nature etc. it would be difficult to recommend much more specific than this.
You might need to model what you want in a module.
You would need to normalize the dimensions and facts so that the objects in your data sets resemble a star schema. This would be done by some combination of modelling tables from your sources and or modelling column dependency.
I was able to use column dependency to munge together two xls files which both had dimension and fact data. The difficult part was modelling the relationship between the tables.
This might be second best.
I'm assuming that the data sets are the things which Cognos calls data sets.
If the data sets are from the same FM model then is it possible to create one data set which combines the objects used to create the two data sets?
It might be better that way rather than re-modelling what has already been modelled.

Related

How to define two different entity roles for the same prebuilt Entity (number) in LUIS

I am looking to build a bot that typically requires two numbers with a different meaning (role) in the same utterance. Let's take the example of a StockMarket order assistent (fictional, as example)
Some example utterances:
Buy 100 MSFT stock at limit of 340
Get me 200 Apple at maximum 239.4
Buy 40 AMZN at market price
In LUIS portal, I have defined two entities
StockSymbol a List entity (for all stocks, linking their symbols and the names as synonyms).
number the prebuilt entity with two Roles: Amount and Limit
When specifying the utterances shown as example, it shows that the entities get recognized. But I cannot find a way to specify the roles for the different number entities in my sample utterances. (in the examples, the first number instance of number is the Amount, and if a second it there, that is typically the Limit role.
Anyone an idea on how to define this and set this up?
Best regards
There are 2 different ways to do this, First is to use roles for a prebuilt entity, go into the number prebuilt, click on Roles, add 2 different roles.
one for Amount another for Limit then you have to go in the utterances and label for the roles, you do that by going to the utterance, clicking on the # symbol on the right, selecting the number prebuilt, selecting the role, then highlighting the numbers with that role.
Second approach is to use ML entities, create 2 ML entities, one for Amount one for Limit. Add the number as a feature and make it a required feature, and then go ahead and label the Amounts with the Amount entity and the limits with the Limit entity directly.

Correct way to label lists in GCP AutoML entity text model

I want to create a model to extract info for PDFs containing purchase orders. I thought that I could create an AutoML text entity model for that task. The main doubt is what's the best way to handle with the article lists. How can I label each cell in order I can have a list of rows in the reuslt
Thanks
The labeling is very important, less than 10 labels to start would make it easy. As you will need at least a 100 entities labeled per label to train. remember you have three sets to label, train, test, validate. 100 for train, 30 for test and 30 for validate should suffice.
check the label tab often, it shows the break down of what has been labeled so far.
google's documentation is a good start. https://cloud.google.com/natural-language/automl/docs/prepare
I ended up building a Java client to call predict on the model, sending it a list of files to process. the returned JSON has the entities by label for each file.

USERELATIONSHIP in a measure with text column

CONTEXT:
I want to monitor payment transactions for money laundering, where payments cross multiple borders. There are a max of 6 countries shown per transaction. For each of these countries, I need to know a risk level.
I have 2 tables:
Transaction data (where there are many transactions from same country)
Country Risk (containing each country once, with an added risk classification. There are 100+ countries, and only 6 different Risk levels).
Problem:
I would like to look up the Risk Classification per country in Transaction Data. The problem is, there are 6 countries per transaction in Transaction Data. So I have to link Transaction data to Country Risk 6 times. Only 1 relationship can be active, of course.
So I tried writing the following measure:
CALCULATE(
VALUES('Country Risk'[Risk classification]);
USERELATIONSHIP('Transaction Data'[Country 2];'Country Risk'[Country Code]))
I get an error though when using the measure in a graph where I listed the countries from Transaction Data (where every country is mentioned in multiple rows) and I wanted to see the related risk categories:
A table of multiple values was supplied where a single value was expected
What am I doing wrong?
Made similar test data: https://drive.google.com/file/d/1_kJW-BpbrwCsbSpxdo7AJ3IzPy2oLWFJ/view?usp=sharing
Needed:
for every C (C1-C6) column I need to add the risk category.
For every C column I need to make a pie chart showing the number of transactions per risk category for that C column
Pie charts should filter the transaction oevrview: (
I've taked a PBI consultant about this, there is no way to get this issue solved the way I want it to (to have multiple relationships between 2 tables all acting as if they were active relationships at same time).
the only way of getting it done would be:
1. write measures (but that doesn't allow cross filtering between pie chart and table below)
2. unpivot the country columns (but that wouldn't allow to have 6 columns with risk category in table)
3. have 6 dimension tables (this solves the issue, because it allows both cross filtering between piechart and other piecharts & table. and it would allow to have 6 columns for separate risks in the table visual)
thanks for trying to help guys!

Need help in choosing right caching strategy

We car planning to store prices data to Memcache. prices are subject to car variant and location(city). This is how it is stored in the database.
variant, city, price
21, 48, 40000
Now the confusion is that how do we store this data into Memcache.
Possibility 1 : We store each price in separate cache object and do a multiget if the price of all variant belongs to a model need to be displayed on a single page.
Possibility 2 : We store prices at the model, city level. Prices of all variants of a model will be stored in a single object. This object will be slightly heavy but multiget wouldn't be required.
Need your help in taking the right decision.
TLDR: It all depends on how you want to expose the feature to your end users, and what the query pattern looks like.
For example:
If your flow is that a user can see all the variant prices on a detail page for a city, then you could use <city_id>_<car_model_id> as the key, and store all data for variants against that key (Possibility 2).
If the flow is that a user can see prices of all variants across cities on a single page, then you would need the key as <car_model_id> and store all data as Json against this key
If the flow is that a user can see prices of one variant at a time only for every city, then you would use the key <city_id>_<car_variant_id> and store prices.
One thing to definitely keep in mind is the frequency with which you may have to refresh the cache/ perform upserts, which in the case of cars should be infrequent (who changes the prices of a car every day/second). So, I would have gone with option 1 above (Possibility 2 as described by you).

How to model an OLTP audit table in dimensional schema?

We have an audit table which we get from OLTP system, it records any activity done by the user including if he downloaded some attachment, or read some note or written some note , or any change for an incident etc.How do we include these audit table activity in our dimensional model for incident management system(IT service management)?
On a simple level, which is all I can provide based on the level of detail in the question, is to look at your audit table and decide which categories of audit you want to be a dimension. Perhaps there are audit_type, user_type, and audit_subtype fields or something like that? Also, typically you have another field called a "measure" or "quantity", which is typically used for stats on numerics, to support aggregate functions. For example, you might typically have store_id, product_cat as categorical dimensions, but roll up sales$ as min,max,avg,stdev grouped by different date types like month, quarter and other dimensions. If your data is purely categorical by date, then COUNT() is usually used as a calculated measure.
You really just need to decide how you want to be able to drill up and drill down though the data, which categories matter, and which quantities matter. Once you decide that, create a flat table with FKs to lookup tables. A star schema is simply a fat table with a bunch of lookup tables floating around it like a star.
Hope this helps

Resources