Wednesday 22 October 2008

Report parameter (Indexed) update problem having list of values

I've a discoverer report parameter 'Product Group (Code)' having LOV's, is based on concatenated column e.g. '13: Services Truck'. This concatenated parameter is based on Product Code i.e. '13' and Product Description i.e. 'Services Truck'.
I've created Indexed item on this concatenated field (reverse to Oracle approach i.e. indexed item as ‘Code’ but here in my case concatenated column is used as Indexed item in disco admin).

I run the report by selecting '13: Services Truck' (Index), it shows data of course; I save the report and close discoverer.

Now I test this scenario by updating this concatenated record in the database, I update it to '13: Services Track' (original is '13: Services Truck’) and commit the sql statement.

update d_corp_article_act_all
set pg_prod_group_conc_en = '13: Services Track'
where pg_prod_group = '13';

I again open the report, by default 'Value' is selected against Product Group (Code) parameter (Value is 13 which I saved previously). I press OK to run the report

Result >>> no data records fetched.

After opening the report if I choose 'Index' from that Indexed item drop down, updated record comes over there i.e. '13: Services Track', I press OK to run the report based on IndexResult >>> shows data record i.e. no problem in this case
I test the final queries which are hitting the database (not the SQL Inspector query which is not final).

In first case after update of record in the database:
After opening the report and doing nothing just executing the previously saved report

In this case the query hitting the database is not picking the update of record i.e.
---
---
AND (( (o100539.PG_PROD_GROUP_CONC) = '13: Services Truck' AND o100539.PG_PROD_GROUP = '13') )
---
---
In the second case after update of record in the database:
After opening the report and selecting ‘Index’ from Indexed item drop down option, updated record is reflected here but only after changing the option from ‘Value’ to ‘Index’

In this case the query hitting the database is picking the update of record i.e.
---
---
AND (( (o100539.PG_PROD_GROUP_CONC) = '13: Services Track' AND o100539.PG_PROD_GROUP = '13') )
---
---
Update of record in the database must be reflected in the report parameter because end user do not know whether the record is updated or not and he/she is not bound to select Index when re-opening the report to fetch the data or to select values from list of values

I tried it while not caching list of values in disco admin but not working.
I also tried to create Indexed item on ‘Product Code’ but in that case there are few alert messages.
According to some people disco is doing nothing wrong that when a description is saved last time and updated in the database and upon re-opening the report report fails because the description is changed, it could be NULL.
But I know that user does not only want to select data based on Code as he doesn't know what's the description of this code so fetching record based on only code is not a solid solution that's why the report parameter is Product Group (Code) but Indexed based on concatenated column to see the description also.
I have noticed one more thing that if for example there are two different descriptions for same code then zero comes as the result instead of no data records i.e.
Product Group (Code) Product description Product Group
13 Services Truck 13: Services Truck
13 Services Car 13: Services Car
Suggestion required!
Thanks
Kamran Safdar