Monday, December 31, 2012

Hierarchical LOV's

One of the new features in IDT are the hierarchical LOV's, which can replace the cascading prompts and are much easier to create.
A hierarchical LOV really lives up to his name, it shows the list of values in a hierarchy that you, as a universe designer, can create. Here is an example of a hierarchical LOV on a time dimension:

This hierarchy has 5 levels, so it is made out of 5 objects. But it can be used to select any of these 5 levels. The hierachy you see below has only 3 levels, but uses the same LOV.

Hierarchical LOV's are LOV's, not prompts. There is no prompt text we can use to communicate to the user. The text that is shown to the user with this hierarchy are the object names, so we must create objects with understandable names.

Now lets create this hierarchical LOV. First I will create all 5 objects and the LOV then I will change the object names for correct communication to the user.

Step 1 Create the 5 special LOV objects

I duplicated the original objects for two reasons. I am going to change the LOV and I want the objects with the default LOV to be available also. Secondly I have to change the name of the objects used in the hierarchical LOV.

Step 2 Create the hierarchy LOV

Go to the Parameters and List of values subview. Click the arrow in the List of values pane and create a new LOV based on business layer objects. 

Name it and be sure to check the option "List of values based on a custom hierarchy". Then add the 5 objects created in step 1 and put them in the correct order, the most dense on top and the most detailed at the bottom.

Step 3 Modify the 5 LOV objects

Select the "Lost Login Moment H-LOV" object and goto the Advanced tab. Check the Associate List of values box and press the ...-button.

Select the "Last Login Moment (Hierarchy)" LOV created in step 2. Then choose the column, that corresponds to this object, "Last Login Moment H-LOV".

You can do the same for the other 4 objects date, month, quarter and year (although the year object is not used).

Step 4 Change the names of the 5 LOV objects for communication

When you use the objects like this in WebI you will get the following LOV screen:

For me this is not a very clear communication to the user. You can see that two object names are used here to communicate. So I change these with more meaningful names: 

Then the LOV properties will look like this:

And when used in WebI you now communicate this:

When an incorrect level of a hierarchy is selected in WebI there is an error when the query is executed. But before that a small red triangle will be shown in the top left corner of the selection box.

When we create Parameters for these LOVs they also can be used in prompts. This is probably why you created these LOVs in the first place. Parameters can be created in the same subview as the LOVs were created. Parameters use the same mechanism to associate LOVs as normal objects.

When you want to use these in WebI you first create a normal prompt in the Query Panel - Query Filters pane, then you click the prompt button to edit the prompt.

And in the Parameters Properties you select the radio button Use Universe Parameters and then the parameters for the object can be selected.

1 comment: