You are currently browsing the tag archive for the ‘programming’ tag.

A lot of times the MDX query needs to look at current date/today date/system date as the reference member. There is no function equivalent to TSQL getdate(), but you can use the following piece of cide snippet to solve the purpose:

StrToMember(“[Date].[Date].[” + Format(now(), “yyyyMMdd”) + “]”)

As an example, if you want to see the Sales for the last 7 days from the system date:

SELECT
 [Measures].[Sales]  ON COLUMNS,
 LastPeriods(7,  StrToMember(“[Date].[Date].[” + Format(now(), “dd-MM-yyyy”) + “]”) )  ON ROWS
FROM [Cube]

Advertisements

I know I know – pop ups are not aesthetic and accepted by the user community, but I had a requirement where the ‘Help’ page is to be brought up as a pop up window.

To accomplish the task, I used the following function:

window.open

It is a method that can be used as under:

open (URL, windowName[, windowFeatures])

URL
The URL of the page to open in the new window. This argument could be blank.

windowName
A name to be given to the new window. The name can be used to refer this window again.

windowFeatures
A string that determines the various window features to be included in the popup window (like status bar, address bar etc)

The following code opens a new browser window with standard features.

window.open ("https://bimoss.wordpress.com","openpopup");

The table shows the features and the string tokens you can use:

status The status bar at the bottom of the window.
toolbar The standard browser toolbar, with buttons such as Back and Forward.
location The Location entry field where you enter the URL.
menubar The menu bar of the window
directories The standard browser directory buttons, such as What’s New and What’s Cool
resizable Allow/Disallow the user to resize the window.
scrollbars Enable the scrollbars if the document is bigger than the window
height Specifies the height of the window in pixels. (example: height=’350′)
width Specifies the width of the window in pixels.

Timeline

December 2017
M T W T F S S
« Mar    
 123
45678910
11121314151617
18192021222324
25262728293031

Blog Stats

  • 43,267 hits