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)
Fetch value from dataset
yashesh
<p>Hi,</p>
<p> </p>
<p>I have 2 datasets where I want to fetch the value from dataset 1 and based on that value I am trying to replace value in dataset 2 in the where clause.</p>
<p> </p>
<p>I have attached an example where in dataset named 'company directory' I have a column emp_id which I need to read in dataset2 named 'purchase orders' and based on that value I am using this.querytext in onfetch method to provide input to the where clause, but its failing.</p>
<p> </p>
<p>Any idea how to fix this?</p>
<p> </p>
<p>Regards</p>
Find more posts tagged with
Comments
JFreeman
<p>There are a few issues I see with your current script and report configuration.</p>
<p> </p>
<p>First, since the Company Directory data set is not bound to any report elements it is not executing when the report is run which is preventing your array from being populated.</p>
<p> </p>
<p>Second, referencing "row["EMP_ID"]" within the second data set will not work as it will be trying to access a row named "EMP_ID" within the current data set and will not access the first data set.</p>
<p> </p>
<p>Additionally, your if statement is configured to check (empid[#] == 103) however, you are populating the empid array with the employee name not ID "empid[row["EMP_ID"]] = row["EMP_NAME"];"</p>
<p> </p>
<p>Take a look at the modified version of your example I have attached for reference.</p>