Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Suppress row based on fields of previous row
HSMorales
I have a table binded to a dataset with 9 fields. In the detail section, I would like to suppress the row if 3 fields are equal to the same 3 fields of the previous row. How can I how this ?
Thanks
BIRT 3.7.0
Find more posts tagged with
Comments
bgbaird
Hi,
I've done this by defining a global report variable, then in the onCreate script, assign a value from that row to the variable. When the next table row creates, you can call the variable to evaluate against.
In this example, I've only assigned the variable to the value of one field, but it could be done with concatenation, or multiple variables.
Brian
HSMorales
not quite working yet.
in the onCreate for the row I have
reportContext.setGlobalVariable("previousRQ_ID", row["RQ_ID"]);
reportContext.setGlobalVariable("previousTEXT_CD", row["TEXT_CD"]);
reportContext.setGlobalVariable("previousPO_ID", row["PO_ID_9"]);
for the visibilty I have
(row["RQ_ID"]==row["previousRQ_ID"]) && (row["TEXT_CD"]==row["previousTEXT_CD"]) && (row["PO_ID_9"]==row["previousPO_ID"])
I tried displaying the variables in the row and they are equal to the previous and current fields.
Do I have a syntax error maybe.
Do I need to define the variables somewhere else ?
Thanks for you help.
bgbaird
Did you make the new culumnbinding called varValue (reportContext.getGlobalVariable("previousConditionValue"))
HSMorales
Where do I do this and do I need three different bindings with diferent names for the three variables ??
bgbaird
I don't know what your datatypes are.
You could define 3 new column bindings on your table:
varPrevRQ: reportContext.getGlobalVariable("previousRQ_ID");
varPrevTX: reportContext.getGlobalVariable("previousTEXT_CD");
varPrevPO: reportContext.getGlobalVariable("previousPO_ID");
Then visibility condition:
(row["RQ_ID"]==row["previousRQ_ID"])
&& (row["TEXT_CD"]==row["previousTEXT_CD"])
&& (row["PO_ID_9"]==row["previousPO_ID"])
bgbaird
Start small, make it work with one value, then two, then three.
It makes it much easier to test.
Brian
HSMorales
Works great. Thanks for all the help.