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)
using a single parameter multiple times in query builder
gourav
<pre class="_prettyXprint">where(( :ls_tp = 'Y' and a.code = c.sel_cd )or( :ls_tp = 'N' and str(a.code) between str(:fr_no) and str(:to_no) and c.sel_cd = '0'))</pre><p>ls_tp is the parameter used in where clause 2 times but on seeing the output coloums it gives error and says 2nd parameter is not defined pls. help</p><p>fr_no and to_no are also parameter used in the clause</p>
Find more posts tagged with
Comments
mwilliams
<p>What is your BIRT version?</p>
gourav
<p>I don't know the birt version but the eclipse I am using is indigo and I have Just added the new software from help. birt run time that I am using is 4[font="Arial, sans-serif;font-size:10pt;"].3.1 [/font]</p><p> </p><p> </p><p>the basic thing i want to sort out in this question is about using one param value more than 1 time if possible, otherwise adding the same para 2 times or as required can sort the problem</p><p> </p><p> </p><p>thank you</p><p>Michael</p>
mwilliams
<p>You'll need to create a dataset parameter for each parameter needed in the query. You can tie multiple dataset parameters to a single report parameter, but each condition will need its own dataset parameter. Hope this helps.</p>
gourav
<p>thanks [color=rgb(164,164,164);font-family:'Source Sans Pro', sans-serif;]Michael Williams[/color]</p>
mwilliams
<p>No problem. Let us know whenever you have questions!
</p>
DGI Systems
<p>You can also use the WITH clause, below is a dummy example:</p><p> </p><div>WITH </div><div>dsp AS </div><div>(SELECT ? as StartDate, ? AS EndDate)</div><div> </div><div>SELECT SUM(sn.Sales) as Sales</div><div>FROM Sales_North sn, dsp</div><div>WHERE sn.TransactionDate between dsp.StartDate and dsp.EndDate</div><div>UNION</div><div>SELECT SUM(ss.Sales) as Sales </div><div>FROM Sales_South ss, dsp</div><div>WHERE ss.SaleDate between dsp.StartDate and dsp.EndDate</div><div> </div><div> </div><div>Then set two data set parameters as you normally would to match the ?'s - StartDate and EndDate. You can use the alias' as many time as you like without creating more data set parameters.</div><div> </div><div>I hope this helps.</div><div>David</div><div> </div><div> </div><p> </p><p> </p>