What is summation for current group in rtf template? - obiee

I developed a oracle 10g BI Publisher report and having one issue. I am trying to sum value by current group but I am not getting correct results. Please help me.
<?sum(current-group()/DR[.!=''])?>
Ex: I have <?sum(current-group()/DR[.!=''])?> value is 19,234,770,654,698.34. I had sum with calculator each amount in this group is not equal to above result. Manual summation result is 19,234,770,654,698.33.

Although it is quite late, but hope you will find this answer useful as It worked for me. Replace TAN_AMT with your column name and place that in the appropriate place.
<?sum(current-group()/TAX_AMT)?> - <?sum(current-group()/TOTAL_AMT)?>

Related

Interactive Grid- Automatic Row Processing (DML) : Character limitation in Code editor

I have a requirement where 300 columns had to be processed. I am trying to achieve this using IG automatic row processing (DML). When writing the code in the editor I get a error stating 'Value too long by 2015 characters'.
I suppose this is an Oracle Apex limitation. Can someone please share their views on this?
When writing the code in the editor ...
I'd say that your problem isn't related to number of columns, but a large query which can't fit into "SQL Query" item of the Page Designer.
Which Apex version do you use? I can't tell for sure (as I don't know it), but my impression is that Apex up to version 4.2 had that item limited to VARCHAR2(4000) so - if your query is larger than that, it won't fit (such as in your case - query you wrote is 2015 characters longer than the maximum size the item allows). In 5.x version, you can put a whole lot of query into the item (as if it was modified to a CLOB).
Now, as you use Interactive Grid and it appeared in 5.x version, huh ... maybe what I wrote above isn't entirely true. Unfortunately, you can't switch to a query whose source is a function that returns query (such as in Classic Reports), as you could write a (stored) function and simply call it from Apex.
As you said that you used automatic row processing, did you put too much code somewhere in there?
On the other hand, I Googled a little bit, looking for limit of column numbers in the IG - couldn't find anything official, but someone complained (here, on StackOveflow) that they tried to create an IG with over 100 columns, and it didn't work.
So, yes - maybe you hit the limit, but I can't confirm it. Hopefully, someone who knows Apex better will be able to assist. Alternatively, consider asking the same question on OTN forums, as people who designed Apex answer questions there.

Crystal Report get sum error

I watched video tutorial about Crystal Reports. I am confused because when I click Insert > Summary the Sum, Average and etc. are not on the list of Calculate this summary
I tried to search web but no luck. Please help me fixing this.
That would be because Crystal sees this field as a STRING and can't sum a string. You can write a formula field that will convert a string to a numeric and then do a summary of the formula:
Val ({YourTable.total})
#Icebergman_NewProgrammer, Your Sum field is a nvarcha/nchar or others.
plz check this and insure this int/decimal/numeric etc.

percentile_approx in hive returning zero

I have been trying to check the percentile_approx for a set of users. The intention behind this is to get the top 25% of customers in the data set. So, in order to check that, I ran the following HIVE query.
select percentile_approx(amount, 0.75)
from sales
However, the value returned from this query is 0.0. I am not sure what the problem is. When I run this query over a sample of few records the result is what is expected.
Can anyone please shed some light on this?
Note - I am trying to find the percentile in a data set containing more than 3.3 M records.
select percentile_approx(cast(amount as double), ARRAY(0.75))
from sales
Try this method
Generally percentile_approx() works on integer type data. Please make sure that you have applied this on the column which has integers.

JqGrid sorting & grouping dates

I have the following issue: I have a large grid, that is primarily sorted by date since the load. This particular table also has the ability to group, as shown in the following image:
(Sorry for posting an image like this, but thanks to the spam filter, i cant directly insert one here)
Issue is that when i group by date (do note that this behavior is not observed in other columns other than date) this happens:
But if i order the date in to the other way, such behavior is no longer observed
I should note also that this implementation is under ASP.MVC 3. I tried to format the date differently, but without avail.
Thanks for your time
If the problem is only the order of sorting (see comments to the question) I think one could solve the problem by the usage sorttype as function. See the old answer and this one for details.

Oracle spool Number rounding

I am calculating sum of all sales order (by multiplying quantity and price of a sales order - assume one sale order has only one item and using the sum function) in SQL query and I am spooling the output to a CSV file by using spool C:\scripts\output.csv.
The numeric output I get is truncated/rounded e.g. the SQL output 122393446 is made available in CSV as 122400000.
I tried to google and search on stackoverflow, but I could not get any hints about what can be done to prevent this.
Any clues?
Thanks
I think it is a xls issue.
Save as xls.
format column -> number with 2 decimals for example.
Initially I thought it might have something to do with the width of the number format which normally is 10 (NUMWIDTH) in sqlplus, but your result numeric width is 9, so that can not be the problem. Please check your query if you use a numeric type that doesn't have the required precission, and thus makes inexact calculations.

Resources