Jump to content

What is the format to use to display large numbers ?


Martin Yergeau
Go to solution Solved by David Beagan ,

Recommended Posts

I remember that a new format (or a function) has been introduced to display large numbers with the "M" & "K" annotation for million and thousands but I can't find it.

Searching in product documentation gives hundred of pages of document that are, for most of then, unrelevant to my serach.

Does someone can help ?

Regards,

Link to comment
Share on other sites

  • Solution

With the newer field formats, fields can be displayed in millions or billions and many other formats. This example from the Describing Data With WebFOCUS® Language, Page 127 shows how:

DEFINE FILE GGSALESNEWDOLL/D12.2 = DOLLARS * 100;ENDTABLE FILE GGSALESSUM DOLLARSNEWDOLL/D12.2nM AS 'Millions'NEWDOLL/D12.2nG AS 'Billions'BY CATEGORYON TABLE SET PAGE NOLEADON TABLE SET STYLE *GRID=OFF,$ENDSTYLEEND

image.png.55ebde4f3ff4d476a8383e4bba32bb6f.png

Link to comment
Share on other sites

What version are you using? If the simple format isn't available, then the function probably isn't either. But here's the syntax in case someone else is looking for it. This is what is in the Functions Users' Manual:

TABLE FILE WF_RETAIL_LITE

SUM DAYSDELAYED

QUANTITY_SOLD

COGS_US

COMPUTE CDAYS/A30= COMPACTFORMAT(DAYSDELAYED);

CQUANT/A30= COMPACTFORMAT(QUANTITY_SOLD);

CCOGS/A30= COMPACTFORMAT(COGS_US);

ON TABLE SET PAGE NOPAGE

ON TABLE SET STYLE *

GRID=OFF,$

ENDSTYLE

END 

Link to comment
Share on other sites

Hi Debra,

The only thing that does COMPACTFORMAT seems to remove separators and dollars sign, not adding the thousand (K) anotation



TABLE FILE WF_RETAIL_LITE SUM DAYSDELAYED COMPUTE CDAYS /A30 = COMPACTFORMAT(DAYSDELAYED); QUANTITY_SOLD COMPUTE CQUANT /A30 = COMPACTFORMAT(QUANTITY_SOLD); COGS_US COMPUTE CCOGS /A30 = COMPACTFORMAT(COGS_US); ON TABLE SET PAGE NOPAGE ON TABLE SET STYLE * GRID=OFF,$ ENDSTYLE END

image.png.5d623bfd7146e5f6d78c3add0a590e84.pngNot working 😥

Link to comment
Share on other sites

We have some in-house written WebFocus functions. Some are used to run in-house written SQL functions, some to do WebFocus commands. The basic syntax for the WF function:

DEFIINE FUNCTION FUNCTION_NAME (INPUT_PARM/format)

<code>

FUNCTION_NAME/format = <return value>;

END

We put each function in a fex file with the function name (FUNCTION_NAME.fex) and save it in the baseapp folder. I think it can be in any folder in the application path.

Then you have to define the function to the system. This means updating the EDASPROF.prf file with an include:

-INCLUDE FUNCTION_NAME

I hope this helps!

Link to comment
Share on other sites

Thanks Debra,

Already have the doc from "Creating Reports With TIBCO® WebFOCUS Language"

My challenge now it that, since I am using a custom function "short number" which is returning an alpha field, I now have to manually creates the total report rows and also have them converted in a "short number" annotation, merge with detail and display properly.

I know how to do it (did several times), but just a pain since the "nK", "nM" and "nG" field format are still numeric fields that can be summarized.

Wish I had a newest version to use these new functionalities...

Link to comment
Share on other sites

@Debra Waybright

I found a nice feature that could let you avoid having the define function code run every time in the edasprof.prf. Suppose in a function_lib.fex you had (as well as other functions):

DEFINE FUNCTION CUBE(n/P9) CUBE/P9 = n * n * n; END

then in your report fex you could code:

TABLE FILE ggsalesPRINT SEQ_NOCOMPUTE CUBED/P9 = DF.FUNCTION_LIB.CUBE(SEQ_NO);WHERE SEQ_NO LE 20END

This is documented in Describing Data manuals as far back as 8.2.01 for use in Defines in a master file. But it does not appear in the Creating Reports manuals, even though it works in reports. So I guess it would be debatable about whether this was officially supported for use in reports.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...