Author Topic: dynamic/selectable display of decimals  (Read 402 times)

Offline hespora

  • Statesman
  • ******
  • Join Date: Nov 2015
  • Posts: 362
  • Forum Citizenship: +22/-0
dynamic/selectable display of decimals
« on: 25 Jul 2017 03:16:36 am »
I'm creating a report on the price spread over time for selectable products. One thing I'd like to add as bells & whistles is to make the display of decimals either dynamic or user-selectable. I.e., when the price range for my product is in the hundreds, I don't really care if a value is 495.60 or 496.31, they can both be displayed as 496. But if the range is in single digits or even fractions, obviously I'm going to need to display decimals.

First thing I thought was to make a copy of my list, stick both copies into separate cards of a deck - one is formatted with decimals, one is not, and select the card via a toggle button. That technically works fine, but noticeably increases the run time of the report - apparently, the second list also fires the query against the database, even though I've set the query hint "use local cache" to yes. So I'm somewhat reluctant to use this approach.

Does anyone have any other idea on how to make decimal display selectable?

Offline MFGF

  • Never knowingly correct
  • Super Moderator
  • Statesman
  • ******
  • Join Date: Jul 2005
  • Posts: 10,271
  • Forum Citizenship: +620/-10
  • Cognos Software Muppet
Re: dynamic/selectable display of decimals
« Reply #1 on: 25 Jul 2017 06:22:51 am »
I'm creating a report on the price spread over time for selectable products. One thing I'd like to add as bells & whistles is to make the display of decimals either dynamic or user-selectable. I.e., when the price range for my product is in the hundreds, I don't really care if a value is 495.60 or 496.31, they can both be displayed as 496. But if the range is in single digits or even fractions, obviously I'm going to need to display decimals.

First thing I thought was to make a copy of my list, stick both copies into separate cards of a deck - one is formatted with decimals, one is not, and select the card via a toggle button. That technically works fine, but noticeably increases the run time of the report - apparently, the second list also fires the query against the database, even though I've set the query hint "use local cache" to yes. So I'm somewhat reluctant to use this approach.

Does anyone have any other idea on how to make decimal display selectable?

Hi,

A much more efficient approach would be to add the same item to your list as two separate columns, each formatted differently (one with decimals and the other not). You can then select each column and in properties, use the Column Visibility property to hide or show the column based on the value in an active report variable (set by buttons or a dropdown). This way you only have one list retrieving the value once and displaying it in different formats.

Cheers!

MF.
Meep!

Offline hespora

  • Statesman
  • ******
  • Join Date: Nov 2015
  • Posts: 362
  • Forum Citizenship: +22/-0
Re: dynamic/selectable display of decimals
« Reply #2 on: 25 Jul 2017 07:39:41 am »
Oh wow - i did not realize that active report variables could interact with layout properties. Thank you very much! :)

 


       
Twittear