The order (sequence) of set members imported into GAMS - gams-math

I want to import elements or members into a GAMS set from other sources, say SQL DB. For example set p plant /p1,p2,p3.../ These elements are successfully imported, however, it seems that they are not ordered, because errors will be reported when I use condition clause like ord(p) > 3 in constraints.
I know that elements are ordered as they initially created. So these imported elements are supposed to follow the sequence as imported. When I display this set, elements are shown as p1, p2, p3...
So I am really confused about the ordering of imported elements. I want to figure out the reason and if there are ways I can fix their order. Thanks.

you could add the following after loading the data
ALIAS(*,universe);
display universe;
$exit;
You should then see the order of your loaded set elements and where the misordering might have appeared. If you absolutely cant order the set in your source query (sql db) a hack would be to initiate a helper set before loading the actual data.
set helper /p1*p100000/;

Related

React-Admin filters that relate to the current results

We're really enjoying using the capabilities offered by React-Admin.
We're using <ReferenceArrayInput> to allow filtering of a <List> by Country. The drop-down contains all countries in the database.
But, we'd like it to just contain the countries that relate to the current set of filtered records.
So, in the context of the React-Admin demo, if we've filtered for Returned, then the Customer drop-down would only contain customers who have returned items (see below). This would make a real-difference in finding the records of interest.
Our current plan is to (somehow) handle this in our <DataProvider>. But, is there are more ReactAdmin friendly way of doing this?
So you want to build dependent filters, which is not a native feature of react-admin - and a complex beast to tame.
First, doing so in the dataProvider will not work, because you'll only have the data of the first page of results. A record in a following page may have another value for your array input.
You could implement that logic in a custom Input component instead. This component can wrap the original <ReferenceArrayInput> and read the current ListContext to get the current data and filter value (https://marmelab.com/react-admin/useListContext.html), then alter the array of possible values using the filter prop (https://marmelab.com/react-admin/ReferenceArrayInput.html#filter).

Binary Sankey Diagram in Tableau - Not All Activities Match The Corresponding Number of KPIs

How do I link my activities variable to only the corresponding KPIs variable?
Using guidance from a number of sources, but primarily the genius of Jeffery Shafer articulated through the SuperDataScience video, I built a Sankey Diagram for my work. For the most part it works, however, I have been trying to figure out how to adjust my Sankey Diagram model to line up each activity with ONLY the corresponding KPIs, but am having no luck.
The data structure looks like this:
You'll note I changed the binary value to "", 2 instead of 0, 1 as it makes visual calculations easier. For the "Viz" variable, I have "Activity" for the raw data set, then I copy/paste/replicate the data to mirror the data (required for the model) but with "KPI" for the mirrored data.
In the following image, you'll see my main issue is that the smallest represented activity still shows as corresponding to all KPIs when in fact it does not. I want activity to line up only with the corresponding KPIs as some activities don't correspond with all, or even any, KPIs.
Finally, here is the model very similar to what the above video link shows:
Can someone help provide insight into how I can adjust the model to fit activities linking only to corresponding KPIs? I appreciate any insight. Thanks!
I have a solution to the issue, thanks to a helpful Tableau support member named Anthony. It was in the data structure. The data was not structured to only associate "Activities" with their "KPI" values within Tableau's requirements, but every "Activities" value with every "KPI" value. As a result, to achieve the desired result, the data needs to be restructured to only contain a row for every valid "Activities" and "KPI" combination. See the visual below where data is removed to format properly:
-------------------------------------->
Once the table is restructured, the desired visual result should configure with the model. It works like a charm!
Good luck out there!

Heat map visualization issue Microstrategy VI

I am creating a Dashboard using as a visualization a heat map. Everything was OK until I changed the parameters of my metric, the chart disappeared and I've got this message: 'Filter excludes all data'
The only modification that I've done is to set the Include Distinct Elements to true within the Count Parameter option of the metric.
What could be happening?. Do I need to set another parameter to get the count of distinct elements that I need?
Regards.
surely the metric is level with some attribute that is not inside the visualization, if the filter has date for example, include it in the visualization.
"Filter Excludes All data" is a default warning message that you will get in MicroStrategy when a reports/visuals/dashboards does not return any data.
https://community.microstrategy.com/s/article/KB47557-How-to-Properly-Suppress-the-Message-Filter-excludes-all?r=1&Component.reportDeprecationUsages=1&Headline.getInitData=1&ArticleView.getArticleHeaderDetail=1&Quarterback.validateRoute=1&RecordGvp.getRecord=1&ArticleRichContent.getArticleAuthor=1&ArticleTopicList.getTopics=1&ArticleRichContent.hasArticleAccess=1&ForceCommunityFeed.getModel=1&ArticleRichContent.getTopicsAssigned=1
There are n number of reasons for a report which cannot return data, please check the following steps to debug the issue,
As per your first image it shows a date range as filter, after you have changed to "Include only distinct" this date range might get affected so please put the objects in grid and apply the date filter and check whether it returns the correct data.
If it returns, check whether all the metrics returns a value.
Check whether candidateID, date and people attributes/metrics are properly related.
These steps will show, where the problem is, still if you could not figure it out export the dashboard and share it with MicroStrategy Tech Support team for debugging.
Hope it helps.

Usage of ATG PaymentGroupMapContainer

I looked through documentation and some of the source code too, but am not able to understand the exact use of PaymentGroupMapContainer . I have a sample code - getPaymentGroupMapContainer().addPaymentGroup(ITEM_DESC_GIFT_CARD, giftCard); and in a similar way other payment groups are also added to the container. What if we have multiple gift card, how should this be handled? I am just not able to get the reason why PaymentGroupMapContainer exist
As you've rightly identified, a PaymentGroupMapContainer, can only contain one payment type of type ITEM_DESC_GIFT_CARD. However an order can contain more than one PaymentGroup so to add multiple giftcards to the same order you need to adjust your logic slightly.
First ensure that you create a new PaymentGroup
GiftCard giftCard = (GiftCard) getPaymentGroupManager().createPaymentGroup("giftCard");
Now when you need to apply the giftCard:
getPaymentGroupManager().addPaymentGroupToOrder(order, giftCard);
Obviously there is a lot more to do around getting the GiftCard configured but the above should resolve your original problem about adding multiple GiftCards to a single order.

SRSS: Dynamic amount of subreports in a report

it might be possible I'm searching for the wrong keywords, but so far I couldn't find anything useful.
My problem is quite simple: At the moment I get a list of individual Ids through a report parameter, I pass them to a procedure and show the results.
The new request is like this: Instead of showing the list for all individuals at once, there should be a list for each individual id.
Since I'm quite a beginner in srss, I thought the easiest approach would be the best: Create a subreport, copy the shown list, and create a subreport per individual id.
The amount of this IDs is dynamic, so I have to create a dynamic amount of subreports.
Funny enought, this doesnt seem to be possible. This http://forums.asp.net/t/1397645.aspx url doesnt show exactly the problem, but it shows the limit of the subreports.
I even ran trough the whole msdn pages starting http://technet.microsoft.com/en-us/library/dd220581.aspx but I couldnt find anything there.
So is there a possibility, to create a loop like:
For each Individual ID in Individual IDs, create a subreport and pass ONE ID to this?
Or is there another approach I should use to make this work?
I tried to create a 'Fake'-Dataset with no sql query but just for iterating the id list, but it seems the dataset needs a data-source...
As usual, thanks so far for all answers!
Matthias Müller
Or is there another approach I should use to make this work?
You didn't provide much detail about what sort of information needs to be included in the subreport, but assuming it's a small amount of data (say, showing a personnel record), and not a huge amount (such as a persons sales for the last year), a List might be the way to go.
I tried to create a 'Fake'-Dataset with no sql query but just for iterating the id list, but it seems the dataset needs a data-source...
All datasets require a data source, though if you're merely hard-coding some fake return data, any data source will do, even a local SQL instance with nothing in it.