Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
using results from one dataset to alter another dataset
cmrdjr
I have a dataset that needs have dynamic sql based on a value. In one iteration of the the report I can use a parameter in the script to determine what sql to run. In this other iteration I have to get the value for the script from a different query. Is this possible/feasible?
ex:
Q1 results
name, flag
jon, Y
mary, N
Q2
if flag = Y
this.queryText = this.queryText.replace(a,b)
else <flag=N>
this.queryText = this.queryText.replace(a,c)
end if
Find more posts tagged with
Comments
JasonW
Yes this is possible as long as the first dataset is bound to an item prior to the second dataset. Take a look at the attached example. It runs a first query that returns the max qty. This dataset is bound to a table with two detail rows. The first detail row is hidden but contains an expression that sets a global js var by not using the var keyword. The second datset uses this var and is embedded in the second detail row.
Jason
cmrdjr
YEAH! That works. Thanks for helping.