cancel
Showing results for 
Search instead for 
Did you mean: 

Hide a field in a crosstab

Former Member
0 Kudos

I have  crosstab that has a few cells which show "00:00:00".  (This is a time amount created by converting total number of seconds to hours, minutes and seconds)

Is there a way to "hide" these and just show an empty cell?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

JWiseman
Active Contributor
0 Kudos

hi C Warner,

if you right click on one of the cells and choose Format Field > go to the Common tab > choose Display String

you can use syntax like

if currentfieldvalue = time('00:00:00')

then ''

else totext(currentfieldvalue)

Former Member
0 Kudos

I tried it, and I get an error "A number is required here"  (at the 00:00:00) part.

I have other another formula in the Display String, as well, to convert from seconds.  So here is my current code:

numbervar ts:= currentfieldvalue;
numbervar hs;
numbervar ms;
numbervar ss;


hs:= truncate((remainder(ts,86400))/3600);
ms:= truncate((remainder(ts,3600))/60);
ss:= truncate(remainder(ts,60));
stringvar display:= totext(hs,'00') + ":" + totext(ms,'00') + ":" + totext(ss,'00');


display;

if currentfieldvalue = time('00:00:00')

then ''

else totext(currentfieldvalue)

abhilash_kumar
Active Contributor
0 Kudos

Hi,

Right-click the field > Format field > Common tab > Click the formula button beside 'Suppress' and use this code:

numbervar ts:= currentfieldvalue;
numbervar hs;
numbervar ms;
numbervar ss;


hs:= truncate((remainder(ts,86400))/3600);
ms:= truncate((remainder(ts,3600))/60);
ss:= truncate(remainder(ts,60));
stringvar display:= totext(hs,'00') + ":" + totext(ms,'00') + ":" + totext(ss,'00');

display = '00:00:00'

-Abhilash

Former Member
0 Kudos

Tried it, and I get an error saying "A string is required here"

Former Member
0 Kudos

Hi,

Try this:

Right-click the field > Format field > Common tab > Click the formula button beside 'Suppress' and use this code:

if totext(currentfieldvalue) = totext(time('00:00:00'))

then ''

else totext(currentfieldvalue)

I apply totext() function in the above formula..

How this works..Please update ASAP

Thanks,

DJ

abhilash_kumar
Active Contributor
0 Kudos

Hi,

If this is in continuation to the Crosstab issue that you posted yesterday, then this formula should work:

shared numbervar array arr;

numbervar disp;

if GridRowColumnValue("Times_.Location", CurrentColumnIndex-1) = "VRS Avg" then

(

    if CurrentRowIndex = 0 then

    disp := 0

    else if CurrentRowIndex <= GetNumColumns then

    disp := (arr[CurrentRowIndex])

    else

    disp := 0

)

else

disp := (CurrentFieldValue);

numbervar ts:= disp;

numbervar hs;

numbervar ms;

numbervar ss;

hs:= truncate((remainder(ts,86400))/3600);

ms:= truncate((remainder(ts,3600))/60);

ss:= truncate(remainder(ts,60));

stringvar display:= totext(hs,'00') + ":" + totext(ms,'00') + ":" + totext(ss,'00');

display = '00:00:00';

This needs to go in the 'Suppress' formula as I suggested above.

-Abhilash

Former Member
0 Kudos

Abhilash,

The formula worked!

Thank you, again!!

Answers (0)