How to find a column in Impromptu reports whether that column is numeric or non-numeric, depending on the datatype some calculations has to be carried out(if numeric).
hello again prapagar,
In Impromptu, open (or create) a report with the relevan columns in and retrieve data. Goto Report and then query. Under the Profile tab, click on query columns. Data type is revealed for each column.
HTH
lex
I've 5 Columns for a report.Those five columns in the database is VARCHAR2.Those Columns can have Numeric as well as Non-Numeric data.here I've to do few calculations if those Columns have Numeric data(still VARCHAR2 in DB) by converting the data using the function STRING-TO-NUMBER else I've to leave it as String.
There is no function to find the data is numeric or non-numeric.
I think u might've got clear picture of my problem.
I've worked with programming languages without datatypes so I get to be a bit inventive with this situation. Your problem intrigued me. String-to-number fails with Alpha data, but string-to-integer doesn't. The best I could come up with using Impromptu functions was this as a flag:
If (string-to-integer (Column) =0 ans ascii-code(Column) <> 48) then ('Alpha') else ('Numeric')
Unfortunately it won't work if the first character of the data item is numeric and the rest alpha.
Does that help?
If you have access to the datasource you could create a numeric version of the data item there or possibly use SQL to do the calculation . A final possibility I can think of which clearly won't always be appropriate, is to use something like Access as an intermediate data source and do the calculation there.
Simon Rouse
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.