Hi
I have a MSTR report where I have 5 metrics. in the last 2 metrics I have a Applysimple function such that
Applysimple("case when #0='A' #1 else #2 end" , ?Prompt1,fact1,fact2)
Here Prompt1 is value prompt.
All facts are from same table and MSTR generates 1 SQL
based on the value of the prompt the SQL becomes
case when 'A'='A' then.......
The problem here is when report is run user needs to enter the value for this and client wants it to be from a drop down list.
Now,
I have created a table whose values are 'A' and 'B'. I created an attribute on it--Att1 and an attribute element list prompt Prompt2.
The metric defs I changed as:
Applysimple("case when #0='A' #1 else #2 end" , Att1@ID,fact1,fact2)
Now in the report I pulled that prompt and the metrics.
The case becomes
case when Att1='A' then....... Since the value of the prompt is A its expected that this condition will be true.
Problem is now MSTR creates 5 SQLs, 1 for the first 3 ,2nd and 3rd for the 2 new metrics. Then 4th for union of the attributes of the SQLs involving these 2 metrics. ANd then final pass where this union SQL is outer joined with the previous 3 passes.
I can check from the first 3 passes that the data matches. However the last 2 passes mess up the thing and finally display datya with all metric values as 0.0
How are all the values becoming this when they are correctly fetched in the previous passes?
And why on earth the 1 SQL change to 5 ??
Please help.
thanks
I have a MSTR report where I have 5 metrics. in the last 2 metrics I have a Applysimple function such that
Applysimple("case when #0='A' #1 else #2 end" , ?Prompt1,fact1,fact2)
Here Prompt1 is value prompt.
All facts are from same table and MSTR generates 1 SQL
based on the value of the prompt the SQL becomes
case when 'A'='A' then.......
The problem here is when report is run user needs to enter the value for this and client wants it to be from a drop down list.
Now,
I have created a table whose values are 'A' and 'B'. I created an attribute on it--Att1 and an attribute element list prompt Prompt2.
The metric defs I changed as:
Applysimple("case when #0='A' #1 else #2 end" , Att1@ID,fact1,fact2)
Now in the report I pulled that prompt and the metrics.
The case becomes
case when Att1='A' then....... Since the value of the prompt is A its expected that this condition will be true.
Problem is now MSTR creates 5 SQLs, 1 for the first 3 ,2nd and 3rd for the 2 new metrics. Then 4th for union of the attributes of the SQLs involving these 2 metrics. ANd then final pass where this union SQL is outer joined with the previous 3 passes.
I can check from the first 3 passes that the data matches. However the last 2 passes mess up the thing and finally display datya with all metric values as 0.0
How are all the values becoming this when they are correctly fetched in the previous passes?
And why on earth the 1 SQL change to 5 ??
Please help.
thanks