Wednesday, June 1, 2011

How to sort Month Prompts like Jan - Dec?

There are couple ways to do this based on the data type of the column:

If the data type is date, then its a very simple process:

In BMM layer click on that month column and apply sort order column to month number.

If the data type is varchar then an additional column needs to be created in the RPD:

Create a logical column say MonSort in the BMM layer with the formula as :

CASE WHEN MONTH = 'MAR - 2010' THEN 1 WHEN MONTH = 'MAY - 2010' THEN 2 WHEN MONTH = 'AUG - 2010' THEN 3 END

Drag it to the presentation layer and save the rpd.

In the prompt:

In the Show section select SQL results:

SELECT Month FROM ABC order by MonSort asc

Until Next Post .... :)

No comments:

Post a Comment