If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Radio buttons for sort the date column

Started by jd, 08 Feb 2011 10:55:46 AM

Previous topic - Next topic

jd

Hi,  I have a list report with date column.

I need to add 2 radio bittons top of the list for sort the date column.

radio button one for ascending and one for descending.

Can I get any help how to achive this?

Thanks

PRIT AMRIT

Well, if you are not keen to use JAVA script then I would suggest to have to two date prompts i.e. One with Ascending sort and another one is Descending sort.

Then Hide/show these two Date Prompts based on your Radio Button prompt input parameter.

Does it make any sense?

Thanks
P

JGirl

Assuming:
1.  You have a numeric date column you can use in YYYYMMDD format (eg. 20110131) called [NumericDate].
2.  You have 1 value prompt, radio buttons with 2 static choices (use and display values 'Asc' and 'Dsc' ) with a parameter called ?DateSortOrder?

In your main query, create a column called [DateSortOrder], derived as
IF (?DateSortOrder? = 'Asc')
THEN ([NumericDate])
ELSE ([NumericDate]*-1)

Then use the [DateSortOrder] column to sort your list in ascending order (as the prompt-driven multiplication by -1 will reverse the order when necessary).

Put your radio button prompt on the report page and make it auto-submit.

melee

Quote from: JGirl on 08 Feb 2011 10:28:48 PM
Assuming:
1.  You have a numeric date column you can use in YYYYMMDD format (eg. 20110131) called [NumericDate].
2.  You have 1 value prompt, radio buttons with 2 static choices (use and display values 'Asc' and 'Dsc' ) with a parameter called ?DateSortOrder?

In your main query, create a column called [DateSortOrder], derived as
IF (?DateSortOrder? = 'Asc')
THEN ([NumericDate])
ELSE ([NumericDate]*-1)

Then use the [DateSortOrder] column to sort your list in ascending order (as the prompt-driven multiplication by -1 will reverse the order when necessary).

Put your radio button prompt on the report page and make it auto-submit.

Wow, nice form JGirl. That makes a lot of sense.

jd

Hi JGirl,

I have only start date column in my report. So can I use this column for [NumericDate] and [DateSortOrder]

or [DateSortOrder] should be different than [NumericDate]?

Thanks


jd

Hi JGirl,

I have followed your below steps but none of the recods come.

Arsenal

Quote from: d.laxmi on 09 Feb 2011 04:20:15 PM
Hi JGirl,

I have only start date column in my report. So can I use this column for [NumericDate] and [DateSortOrder]

or [DateSortOrder] should be different than [NumericDate]?

Thanks

She's asking you to create a value prompt whose parameter she's suggesting be named as DateSortOrder. You don't need a "start date" or "end date" at all .
As per her suggestion, you would also create a data item in your main query called DateSortOrder, or you can name it something else.
And then finally, you would use this newly created data item query to be used to sort the list (grouping and sorting option in the properties pane of the list) ascending (by default when you add this data item into the sort list, it will be set to ascending)


sram007

Hi JGirl,
I have a list report which is having 2 colums like,
Product Line,Product Type i want to sort these colums dynamically so i have added a valueprompt static choice as Asc & Dsc .& in report design i have added a new calculated  item named Sort as given below,
IF (?Sort? = 'Asc')
THEN ([Product Line])
ELSE ([Product Type]*-1)
But Its not working Please Guide me..

Regards,
Ram

jive

Hi SRAM007 ,

Just one thing, when you do number*-1 it's change the order because is a number, with text a doubt this will work.

regards Jacques

sram007

You are right Jive.
Can any one please help me in this case

Cheers,
Ram

jive

HI SRAM,

In the project I work now, we avoid that problem by setting a column in the dimension. that column will hold a number indicating the text position in the order the client want it. That way we can have a text order like 'z','c','u','a' by default or the client can have have it in asc or desc based on the text itself. If they want the same order base on the numeric value but in reverse, I hope I'm clear that sound strange, we used the solution Jgirl propose earlier, mulitply the sort_ket*-1.

Jacques