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)
Max value by group by BIRT
yashesh
<p>Hi,</p>
<p> </p>
<p>I have a table in following format,</p>
<p>product name/product value</p>
<p>honda/10000</p>
<p>toyota/30000</p>
<p>honda/25000</p>
<p>GMC/40000</p>
<p>GMC/15000</p>
<p>toyota/18000</p>
<p>What I need to do is get a name of the product and corresponding max value for that product and get rid of duplicates.</p>
<p>So the output for above example would be,</p>
<p>honda/25000</p>
<p>toyota/30000</p>
<p>GMC/40000</p>
<p> </p>
<p>Since this is coming from flat files, I do not have an option to a select * from distinct. What other methods can I use to get the intented output?</p>
<p> </p>
<p>Thanks in advance.</p>
Find more posts tagged with
Comments
micajblock
<p>What version of BIRT? Ideally if you can send a flat file I can build a quick example/</p>
yashesh
<p>Hi mblock,</p>
<p> </p>
<p>The BIRT version is 3.7. Please see a sample attached.</p>
<p> </p>
<p>Regards</p>
micajblock
<p>Attached is an example (design and CSV). You simply need to select 'Auto Summarize On' when you drag in a table (see image below). The drag in Product Name, since it is a string it will automatically group by that field. Then drag in the Product Price, since it is a float it will automatically create an aggregation. Then all you need to do is change the aggregate from SUM to MAX.</p>
<p> </p>
<p>I hope this helps.</p>
yashesh
<p>Thanks a ton Mica. You guys are the best!</p>