Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Wednesday, June 26, 2013

Concatenate Two Attribute Forms


You can create a new derived metric from an existing metric in the grid. And you can use many of the available function in the derived metric editor. Ist is possible to concatenate two attribute forms using derived metric.  Derived metrics will by default show only the metrics available in the grid.

For example. I have a rerport with the below attributes.



However I need to display the combination of  two attributes forms as below.ie. ID of category and DESC of subcategory.




You can use concat function to join multiple strings. So you need to convert the attribute form into derived metric and then use the concat function. How do we do this ? You can use MAX function to convert the atribute form into a derived metric, so that concat function can recognise the string.  So inset a new metric with the below formulae.

Concat(Max(Category){~}," . ",Max(Subcategory@DESC){~})

This is concatenating the ID form from category with a space dot and decriton form from subcategory.

Now, in my report I am showing all these three columns, ie category, subcategory and categotyID . SubcategoryDESC. How do I display only the concatenated attribute? If I remove the other two attributes from the grid, the derived metric will be empty. Do you have any suggestions other than modifying the width of the the attributes ? Please do let me know.


Microstrategy Project Default Homepage

At my previous project, we had a requirement to showcase a dashboard on a TV. It used a specific username and we did not want to go through shared folder for accessing the dashboard every time we login. So we had to make this dashbaord a default home page. You might be familiar in setting this in Mobile config. However you can do that in web also.

  1. execute the document you want to set up as the default page.
  2. click on the mstrLogo (red star image on top left) and choose preference.
  3. In user preference - > general you will see an option to set up the last executed document / report as the default start page.
  4. So next time you only need to login and you will see your dashbaord executed.

Thursday, June 20, 2013

Passing Prompt Answers in URL


At least couple of times in your project, you might have come across a situation where you need to share a view of your dashbaord or report, based on the prompts that you selected. Fortunately, MicroStrategy supports and provide a way to pass the prompt answers in the URL, So that you can generate the URL and share it with other or you can even use it for stress testing. 

There are few types of Prompts and the parameter for each of these are different.

Prompt Type                                      Parameter
Element list Prompt                              elementsPromptAnswers

Value Prompt                                      valuePromptAnswers

Object Prompt                                    objectsPromptAnswers


Unfortunately i did not see a method for passing  a level prompt in the URL 

Now that we know the parameter for different prompts, lets see how to pass values to these prompts.

  • elementsPromptAnswers
    • AttributeID;AttributeElementID^DisplayName is the formart
    • AttributeID;AttributeElementID^DisplayName;AttributeElementID^DisplayName  --. when you have multiple answer for a prompt. 
    • AttributeID;AttributeElementID^DisplayName;AttributeElementID^DisplayName,AttributeID;AttributeElementID^DisplayName when you have multiple prompts.
  • valuePromptAnswers
    •  Unlike the element prompt, here there is no option to refer to the attribute. Hence the order in which you give the prompt answers will impact the results. If one of the answer is empty, you need to properly delimit that.
    • user carat "^" for delimitation. eg: Books^2013^India . If you dont answer 2013, the format will be Books^^India
  • objectsPromptAnswers
    • The name in the below format is optinal, but without that you will not be able to refer to the prompt in the document. Also since the prompt answers do not have identifiers to map then to prompts, the order in which the prompt is answered is important. 
    • objectID~type~name is the format 
    • objectID1b~type1b~name1b^objectID2a~type2a~name2a  -> multiple objects prompts answered.
    • objectID1a~type1a~name1a%1BobjectID1b~type1b~name1b  -> passing multiple objects in one prompt.
You can find the objectID either from the metadata or more easily from the desktop. Right click and check the property.

Now lets look at constructing the URL.

For a Dashboard, URL is

http://Localhost:8080/MicroStrategy/servlet/mstrWeb?

evt=2048001
&src=mstrWeb.2048001
&documentID=
&ViewMedia=2
&elementsPromptAnswers=

For a Report, URL is
http://localhost:8080/MicroStrategy/servlet/mstrWeb?

&src=mstrWeb.4001
&evt=4001
&reportID=
&elementsPromptAnswers=

Notice the highlighted changes in event number and document / report ID.

Lets look at an example. I have a document with a report, and it has all the below types of prompts. It has object prompt, element prompt. 
Objects          -> attr - category / brand / call center
                      -> metric - profit / revenue
elmemt list      -> limited on the year

How do I add the elments and objects to the url  ? We can follow the method described above. But it becomes tedious and error prone when the number of elements and objects increase. What is the best way to create the url in this case ?

Fortunately, MSTR also supports passing prompts as XML. Now how do we generate an XML. It is Quiet easy.  Just place a dynamic text box in your document for {&PROMPTXML} .


Execute your document and you will see the XML.



You can now insert the xml using the parameter promptsAnswerXML in the URL.