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:

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

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:

It is a method that can be used as under:

open (URL, windowName[, windowFeatures])

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

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

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. ("","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.


June 2017
« Mar    

Blog Stats

  • 42,228 hits