on 09-25-2014 11:34 PM
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.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
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
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
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
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.