Enterprise Power BI Gateway greyed out

The short blog shows you one of the reason your Power BI Data Gateway turn Greyed.

As you can see my data gateway is online.


If it is greyed out then you can check your gateway data source setting.


Must match with your Power BI Desktop Data Source setting.


Reference:

https://community.powerbi.com/t5/Integrations-with-Files-and/Enterprise-Power-BI-Gateway-greyed-out/td-p/147637

Advertisements
Posted in .Net, Cloud, Community, Computers and Internet | Tagged , | Leave a comment

SSAS The record was skipped because the attribute key was not found. Attribute

This short post show you one of the ways to resolve the error “SSAS The record was skipped because the attribute key was not found. Attribute” when processing a cube is SSAS.

The more detail error as below:

Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: ‘dbo_FactRTGMove’, Column: ‘StaffId’, Value: ‘003006’. The attribute is ‘Staff Id’.

Errors in the OLAP storage engine: The record was skipped because the attribute key was not found. Attribute: Staff Id of Dimension: Dim Operator from Database: SsasIncentive, Cube: Ssas Incentive, Measure Group: Fact RTG Move, Partition: Fact RTG Move, Record: 1.

For me is because I tried to process the cube before process the dimension after adding the fact table. Right click your dimension to Process… them before process the cube. This works for me.


Reference:

https://support.microsoft.com/en-us/help/922673/error-messages-when-you-try-to-process-a-database-or-a-cube-in-sql-ser

Posted in .Net, Community, Computers and Internet | Tagged | Leave a comment

Microsoft Cognitive Services: The Language Understanding (LUIS) service

This post shows you there is a possibility for you to connect to light using Azure.

Somehow I still do not know how to connect from Internet back to your home. I guess that is what Microsoft should provide the clear steps on doing this.

Here you can have more information: https://azure.microsoft.com/en-us/services/cognitive-services/language-understanding-intelligent-service/?WT.mc_id=azurebg_email_Trans_33771_1596_Release_MOSP_Tier2_December06

Posted in .Net, Cloud, Community, Computers and Internet | Tagged , | Leave a comment

Power BI Data Gateways not able to apply changes for privacy level in Advanced Settings

This post shows you one of the possible reasons the Apply button has no effect when you click in. This is when you go into Manage gateways, and configuring your data gateways.



Retype in your Windows username and Windows password works for me.

Reference

https://community.powerbi.com/t5/Service/Gateways-Not-able-to-apply-changes-for-privacy-level-Advanced/m-p/294108/highlight/true#M34476

Posted in .Net, Cloud, Community, Computers and Internet, Uncategorized | Tagged , | Leave a comment

Stop Auto Reopen of Programs after Restart in Windows 10

This short blog shows you how to stop auto reopen of programs after restart in Windows 10.

You realize Windows 10 1709 will reopen all the applications when restart. Windows claims this is a better feature. Personally I do not really like it.

The worst part is there no option to set whether I want to reopen my application after restart or not.

What if I want a clean restart then how can I achieve that?

I checked internet and found this blog:

http://www.winhelponline.com/blog/stop-auto-reopen-programs-restart-windows-10/

But the Alt-F4 it does not work for me. Somehow the shutdown.exe /r /t 0 to restart works, reopen.

I found this from Microsoft site.

https://support.microsoft.com/en-us/help/4027599/windows-10-automatically-finish-setting-up-pc-after-update-restart

Again, I have no way to find “Use my sign in info to automatically finish setting up my device after an update or restart”.

I was trying to set the DisableAutomaticRestartSignOn but it did not work for me as well.

https://social.technet.microsoft.com/Forums/windows/en-US/efc99b56-8f1f-4364-b081-0b6db46e9dda/global-policy-for-new-use-my-signin-info-to-automatically-finish-setting-up-my-device-after-an?forum=WindowsInsiderPreview

In short the solution for me is:

shutdown.exe /r /t 0

Microsoft should have a clear way to set this option. Not everyone like to reopen their programs after shutdown or restart.

Posted in .Net, Community, Computers and Internet, Operating System | Tagged , , | Leave a comment

SSAS A duplicate attribute key has been found when processing: Table: ‘dbo_DimDate’, Column: ‘QuarterNumberCalendar’

This post gives you a clue on how resolve the error like “: A duplicate attribute key has been found when processing: Table: ‘dbo_DimDate’, Column: ‘QuarterNumberCalendar'”.

When you hit this message and copy the entire message will be as below.

<Batch xmlns=”http://schemas.microsoft.com/analysisservices/2003/engine”&gt;

<Parallel>

<Process xmlns:xsd=”http://www.w3.org/2001/XMLSchema&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:ddl2=”http://schemas.microsoft.com/analysisservices/2003/engine/2&#8243; xmlns:ddl2_2=”http://schemas.microsoft.com/analysisservices/2003/engine/2/2&#8243; xmlns:ddl100_100=”http://schemas.microsoft.com/analysisservices/2008/engine/100/100&#8243; xmlns:ddl200=”http://schemas.microsoft.com/analysisservices/2010/engine/200&#8243; xmlns:ddl200_200=”http://schemas.microsoft.com/analysisservices/2010/engine/200/200&#8243; xmlns:ddl300=”http://schemas.microsoft.com/analysisservices/2011/engine/300&#8243; xmlns:ddl300_300=”http://schemas.microsoft.com/analysisservices/2011/engine/300/300&#8243; xmlns:ddl400=”http://schemas.microsoft.com/analysisservices/2012/engine/400&#8243; xmlns:ddl400_400=”http://schemas.microsoft.com/analysisservices/2012/engine/400/400&#8243; xmlns:ddl500=”http://schemas.microsoft.com/analysisservices/2013/engine/500&#8243; xmlns:ddl500_500=”http://schemas.microsoft.com/analysisservices/2013/engine/500/500″&gt;

SsasIncentive

Ssas Incentive

<Type>ProcessFull</Type>

<WriteBackTableCreation>UseExisting</WriteBackTableCreation>

</Process>

</Parallel>

</Batch>

Processing Dimension ‘Dim Date’ completed.

Start time: 1/4/2018 7:09:08 PM; End time: 1/4/2018 7:09:08 PM; Duration: 0:00:00

Processing Dimension Attribute ‘(All)’ completed.

Start time: 1/4/2018 7:09:08 PM; End time: 1/4/2018 7:09:08 PM; Duration: 0:00:00

Processing Dimension Attribute ‘Quarter Number Calendar’ completed. 1 rows have been read.

Start time: 1/4/2018 7:09:08 PM; End time: 1/4/2018 7:09:08 PM; Duration: 0:00:00

SQL queries

SELECT

DISTINCT

[dbo_DimDate].[QuarterNumberCalendar] AS [dbo_DimDateQuarterNumberCalendar0_0],[dbo_DimDate].[YearCalendar] AS [dbo_DimDateYearCalendar0_1]

FROM [dbo].[DimDate] AS [dbo_DimDate]

Processing Dimension Attribute ‘Year Calendar’ completed. 6 rows have been read.

Start time: 1/4/2018 7:09:08 PM; End time: 1/4/2018 7:09:08 PM; Duration: 0:00:00

SQL queries

SELECT

DISTINCT

[dbo_DimDate].[YearCalendar] AS [dbo_DimDateYearCalendar0_0]

FROM [dbo].[DimDate] AS [dbo_DimDate]

Errors and Warnings from Response

Internal error: The operation terminated unsuccessfully.

Server: The current operation was cancelled because another operation in the transaction failed.

    Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: ‘dbo_DimDate’, Column: ‘QuarterNumberCalendar’, Value: ‘3’. The attribute is ‘Quarter Number Calendar’.

You only need to look at the last line in this case.

You need to select the right KeyColumns, and NameColumn in Properties.

Posted in .Net, Cloud, Community | Tagged , | Leave a comment

Object Oriented Programming pillars

After almost three decades in IT and two decades in programming industrial. I realized people keep talking about some terms without even understand the fundamental of the concept such as dependency injection.

The four key pillars of object oriented programming listed as below.

1. Abstraction

Abstraction how your code exposing essential feature of an entity while hiding other irrelevant detail. This can reduces code complexity and also makes your aesthetically pleasant.

This is how abstraction looks like using C++.

// Base class

class Shape {

public:

// pure virtual function providing interface framework.

virtual int getArea() = 0;

void setWidth(int w) {

width = w;

}

void setHeight(int h) {

height = h;

}

protected:

int width;

int height;

};

// Derived classes

class Rectangle: public Shape {

public:

int getArea() {

return (width * height);

}

};

class Triangle: public Shape {

public:

int getArea() {

return (width * height)/2;

}

};

2. Encapsulation

Encapsulation is when you hide your modules internal data and all other implementation details from other classes. In order words it is related to Data Hiding. it is also a method of restricting access to certain properties or methods.

To achieve this, we need to use access modifiers, the public, private, and protected especially.

class Adder {

public:

// constructor

Adder(int i = 0) {

total = i;

}

// interface to outside world

void addNum(int number) {

total += number;

}

// interface to outside world

int getTotal() {

return total;

};

private:

// hidden data from outside world

int total;

};

3.Inheritance

Like the word Inheritance literally means it is a practice of passing on property, titles, debts, rights and obligations upon the death of an individual. in OOP this is somehow true(Except the death of an individual) , where The base class(the existing class sometimes called as the Parent class) has properties and methods that will be inherited by the sub class(sometimes called a subtype or child class) and it can have additional properties or methods.

The ability of creating a new class from an existing class.

class Person

{

public:

string profession;

int age;

Person(): profession(“unemployed”), age(16) { }

void display()

{

cout << “My profession is: ” << profession << endl;

cout << “My age is: ” << age << endl;

walk();

talk();

}

void walk() { cout << “I can walk.” << endl; }

void talk() { cout << “I can talk.” << endl; }

};

// MathsTeacher class is derived from base class Person.

class MathsTeacher : public Person

{

public:

void teachMaths() { cout << “I can teach Maths.” << endl; }

};

// Footballer class is derived from base class Person.

class Footballer : public Person

{

public:

void playFootball() { cout << “I can play Football.” << endl; }

};

In the above code snippet MathsTeacher is a Person, and Footballer is a Person. This establish the is a relationship for inheritance.

4. Polymorphism

It us like in biology, Polymorphism refers to the ability to take into different forms or stages. A subclass can characterize its own particular extraordinary conduct and still offer similar functionalities or conduct of its parent/base Subclass can have their own particular conduct and offer some of its conduct from its parent class not the a different way. A parent class can’t have the conduct of its subclass.

// virtpers.cpp

// virtual functions with person class

#include <iostream>

using namespace std;

////////////////////////////////////////////////////////////////

class person //person class

{

protected:

char name[40];

public:

void getName()

{ cout << ” Enter name: “; cin >> name; }

void putName()

{ cout << “Name is: ” << name << endl; }

virtual void getData() = 0; //pure virtual func

virtual bool isOutstanding() = 0; //pure virtual func

};

////////////////////////////////////////////////////////////////

class student : public person //student class

{

private:

float gpa; //grade point average

public:

void getData() //get student data from user

{

person::getName();

cout << ” Enter student’s GPA: “; cin >> gpa;

}

bool isOutstanding()

{ return (gpa > 3.5) ? true : false; }

};

////////////////////////////////////////////////////////////////

class professor : public person //professor class

{

private:

int numPubs; //number of papers published

public:

void getData() //get professor data from user

{

person::getName();

cout << ” Enter number of professor’s publications: “;

cin >> numPubs;

}

bool isOutstanding()

{ return (numPubs > 100) ? true : false; }

};

////////////////////////////////////////////////////////////////

int main()

{

person* persPtr[100]; //array of pointers to persons

int n = 0; //number of persons on list

char choice;

do {

cout << “Enter student or professor (s/p): “;

cin >> choice;

if(choice==’s’) //put new student

persPtr[n] = new student; // in array

else //put new professor

persPtr[n] = new professor; // in array

persPtr[n++]->getData(); //get data for person

cout << ” Enter another (y/n)? “; //do another person?

cin >> choice;

} while( choice==’y’ ); //cycle until not ‘y’

for(int j=0; j<n; j++) //print names of all

{ //persons, and

persPtr[j]->putName(); //say if outstanding

if( persPtr[j]->isOutstanding() )

cout << ” This person is outstanding\n”;

}

return 0;

} //end main()

The Classes

In the above code, the person class is an abstract class because it contains the pure virtual functions getData() and isOutstanding(). No person objects can ever be created because of the pure virtual functions. This class exists only to be the base class for the student and professor classes. The student and professor classes add new data members to the base class. The student class contains a property gpa with data type float that represents the student’s grade point average (GPA). The professor class contains a variable numPubs, with data type int, which represents the number of scholarly publications the professor has published.

The isOutstanding() Function

The isOutstanding() method is declared as a pure virtual function in person. In the student class this function returns a bool true if the student’s GPA is greater than 3.5, and false otherwise.

In professor it returns true if the professor’s numPubs variable is greater than 100. The getData() function asks the user for the GPA for a student, but for the number of publications for a professor.

Now, how to do Polymorphism in C# or Java. It uses the keyword interface. This is where the “Dependency Injection” comes in. I will reserve this in another article.

The below C# code is implementing the above C++ code. You can see there is no pure virtual function.

public interface IPerson

{

void getData();

bool isOutstanding();

}

public abstract class person //person class

{

protected string name = new string(new char[40]);

public void getName()

{

Console.Write(” Enter name: “);

name = Console.ReadLine();

}

public void putName()

{

Console.Write(“Name is: “);

Console.Write(name);

Console.Write(“\n”);

}

public virtual void getData() { }

public virtual bool isOutstanding() { return true; }

}

////////////////////////////////////////////////////////////////

public class student : person //student class

{

private float gpa; //grade point average

public override void getData() //get student data from user

{

base.getName();

Console.Write(” Enter student’s GPA: “);

gpa = float.Parse(Console.ReadLine());

}

public override bool isOutstanding()

{

return (gpa > 3.5F) ? true : false;

}

}

////////////////////////////////////////////////////////////////

public class professor : person //professor class

{

private int numPubs; //number of papers published

public override void getData() //get professor data from user

{

base.getName();

Console.Write(” Enter number of professor’s publications: “);

numPubs = int.Parse(Console.ReadLine());

}

public override bool isOutstanding()

{

return (numPubs > 100) ? true : false;

}

}

References:

What is Abstraction in OOPs? Learn with Java Example. (n.d.). Retrieved 03 Jan 2018, from
https://www.guru99.com/java-data-abstraction.html

Encapsulation in C++ with example. (n.d.). Retrieved 03 Jan 2018, from
https://beginnersbook.com/2017/09/cpp-encapsulation/

Data Encapsulation in C++. (n.d.). Retrieved 03 Jan 2018, from
https://www.tutorialspoint.com/cplusplus/cpp_data_encapsulation.htm

C++ Inheritance. (n.d.). Retrieved 03 Jan 2018, from
https://www.programiz.com/cpp-programming/inheritance

Posted in .Net, Community, Computers and Internet | Leave a comment