Cascading Parameter with Case or If statement using MDX
Hi,
I have a Parameter "Freq"
and have 2 drop down values – Yearly & Quarterly ,
If Quarterly is selected … "Code" needs to be populated from [Format].Quarterly Code
If "Yearly" is selected then needs to be populated from [Format].Code
for the below DataSet Query.
Any help....
WITH
MEMBER [Measures].[ParameterCaption] AS
IIF
[Format].[Code].CurrentMember.Member_Caption = ""
,"UNKNOWN"
,[Format].[Code].CurrentMember.Member_Caption
MEMBER [Measures].[ParameterValue] AS
[Format].[Code].CurrentMember.UniqueName
MEMBER [Measures].[ParameterLevel] AS
[Format].[Code].CurrentMember.Level.Ordinal
SELECT
[Measures].[ParameterCaption]
,[Measures].[ParameterValue]
,[Measures].[ParameterLevel]
} ON COLUMNS
,[Format].[Code].ALLMEMBERS ON ROWS
FROM
SELECT
[Format].[Code].&[I]
,[Format].[Code].&[N]
,[Format].[Code].&[D]
,[Format].[Code].&[I]
,[Format].[Code].&[A]
,[Format].[Code].&
} ON COLUMNS
FROM [ABC]
Hi ,
If you are looking for dynamically concatenating the MDX try using an expression in the dataset itself. If the MDX is very complex in nature and do more operations to construct the MDX you can use custom code itself.
Example for Expression
http://sqlblog.com/blogs/stacia_misner/archive/2010/10/08/29249.aspx
Example for custom code
http://www.purplefrogsystems.com/blog/2008/09/dynamic-mdx-in-reporting-services/
Best Regards Sorna
Similar Messages
-
To replace SAP script with smartform in customer statement using t-code F.27
Hi, I have a requirement to replace SAP script while generating a customer statement form using F.27 with Smartform. The standard program which triggers the SAP script is RFKORD11. Can anyone tell me how can we achieve this. Thanks in advance. BR, Karthik.
Hi
do you find a solution for your issue? Or did anyone else know how to send raw data instead of the pdf or fixed file from transaction F.61?
Thanks for any ideas or help
Axel -
Problem with a sqlite update statement using variables
Flash Builder/Flex 4
I'm trying to create a routine that will allow me to change the name of an author in a sqlite table.
I have this update statement which works with hardcoded data:
//trace("updateName function newAuthorName: " + newAuthorName (returns Dusty));
//trace("updateName function oldAuthorName: " + oldAuthorName (returns Kristin));
updateStmt = new SQLStatement();
updateStmt.sqlConnection = conn;
var sql:String = "UPDATE tableName SET authorNameColumn = 'Dusty' WHERE authorNameColumn = 'Kristin' ";
updateStmt.text = sql;
updateStmt.execute();
If I change the statement to
"UPDATE tableName SET authorNameColumn =" + newAuthorName + "WHERE authorNameColumn =" + oldAuthorName;
I get SELECT error: SQLError: 'Error #3115: SQL Error.', details:'near 'authorNameColumn': syntax error'
I've tried changing many things about this statement trying to isolate the problem, but it seems to not like the variables.Lee;
Thanks for your help.
I'm relatively new to this Flex stuff.
I've been trying to fix this problem for hours and you know how it is when you keep looking at the same thing for too long.
The article you linked to helped. I finally just copied the text from it and changed the variable name to my own.
FINALLY!! I can go do something else now.
Grins
Kristin -
Read function block parameter with its object dictionary index in VC?
How do I read a function block parameter with its object dictionary index using NI-Fbus Communications Manager Programmer VC API?
You can use marco NIFB_INDEX(index) as parameter for nif_ReadObject function. The index is the relative index of the parameter in the block.
nifError_t nifReadObject(nifDesc_t ud, NIFB_INDEX(uint32 idx), void *buffer, uint8 *length)
Please also refer to 'NI-FBUS Hardware and Software User Manual' from Start->National Instruments->NI-FBUS->Manuals. Page 6-41 ~ Page 6-44 describe the detail information about nifReadObject() function.
Page 6-51 ~ Page 6-52 explain the usage of marcos for processing index.
Feilian (Vince) Shen -
Using Presentation variables..along with case statements..
Hi All.
I have a issue using presentation variable along with CASE statements. My approach is
1) I have a dashboard prompt, which is being set as Presentation variable.
Based on the value selected in prompt, for ex the values of prompt can be 'ABC' and 'DEF'.
I have a calculated column, the calculation goes this way...
The forumal is
CASE WHEN @{Presentation Variable Name} = 'ABC' THEN xxxxxxxxxx ELSE IF @{Presentation Variable Name} = 'DEF' END. It gives error of "no table being referenced"..
Is this is the right approach??
Can i get the values of variable in a column formula, so that a column can have values selected in prompt?
Can anybody pls help me here..
Thanks in advance...Hi
Thanks for the quick response..
I agree to ur point..
But the requirement is
Based on the value of the prompt I need to switch the calculation in one of the formula area of one column..
If Prompt value is ABC then one kind of calculation in Fx and If the prompt value is DEF then one kind of calculation in the same Fx..
How can I acheive this?
Thanks in advance.. -
How to pass Cascading Parameter in SSRS using Java
How to pass Cascading Parameter in SSRS using Java---
We are having a problem with dependent parameters.There are three drop down--
1.first dropdown is of Country.When we select a country--Accordingly next dropdown(State)will populate
2.Second dropdown is of State. When we select a state--Accordingly next dropdown(City)will populate.
I have three data sources are
CountryList-
SELECT CountryRegionCode, Name
FROM Person.CountryRegion
ORDER BY Name
StateList
SELECT StateProvinceID, StateProvinceCode, CountryRegionCode
FROM Person.StateProvince
WHERE CountryRegionCode = @CountryRegionCode
ORDER BY StateProvinceCode
CityList
SELECT StateProvinceID, City
FROM Person.Address
GROUP BY StateProvinceID, City
HAVING (StateProvinceID = @StateProvinceID)
ORDER BY City
Ihave to show report that has been deployed on server on the besis of these parameters
I am using ReportViewer in JSP Page through url--
http://192.168.90.149/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project1%2fCascading_Parameters&rs:Command=Render&rs:parameter=true&Country="+Country+"&State="+State;
But it is not accepting parameter if they are cascaded.It is working fine if Both parameters are independent.
Edited by: kaushlee on May 11, 2010 9:22 PMTake a look at set_custom_property:
public static final ID SETTEXT = ID.registerProperty("SETTEXT");
public boolean setProperty(ID pid, Object value)
if (pid == SETTEXT)
String text = value.toString();
and in forms
set_custom_property('beans.bean_item', 1, 'SETTEXT', 'some text');
cheers -
11g outer join with case statement - strange results.
Hello All,
I am experiencing a strange issues in 11g while using case statement.
I am not able to reproduce this using sample data. Not sure what is wrong.
I am not narrowing it to say the usage of case statemnt is giving wrong results, but that is my observation when I am doing trail and error testing.
Here are the details.
My Version
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
SQL> My Query
SELECT *
FROM (SELECT DISTINCT mf.schedule,
mf.cptcode,
NVL (mf.modifier, '00') modifier2,
CASE
WHEN mf.feetype = 'H'
AND mf.multiplier IS NOT NULL THEN
' 0.00'
WHEN (mf.feetype != 'H'
OR mf.feetype IS NULL)
AND mf.rbrvsvalue IS NOT NULL
AND mf.multiplier IS NOT NULL THEN
LPAD ( TRIM (TO_CHAR ( (mf.rbrvsvalue * mf.multiplier) / 100, 9999999.99)), 10)
ELSE
NULL
END
fee
FROM provider.mpifee mf, mpi_udffee.udffeeactivecptcodes vld
WHERE mf.schedule = 'SAPG1'
AND mf.cptcode = vld.cptcode
AND NVL (mf.modifier, 'NULL') = NVL (vld.modifier, 'NULL')) inline_fee,
(SELECT arc.schedule col1, arc.procedurecode col2, NVL (arc.modifier, '00') AS col3
FROM mpi_udffee.udffeeancfeedata arc
WHERE monthofextract = '201202'
AND arc.schedule = 'SAPG1'
AND TRUNC (SYSDATE - 10) BETWEEN arc.recordeffectivedate AND arc.recordterminationdate) inline_data
WHERE inline_fee.schedule = inline_data.col1(+)
AND inline_fee.cptcode = inline_data.col2(+)
AND inline_fee.modifier2 = inline_data.col3(+);
In the above query the inline view inline_data returns zero rows. but NVL is still getting applied for col3 and I am getting 00 in the results( strange ).
Results:
SCHEDULE CPTCO MODIFIER2 FEE COL1 COL2 COL3
SAPG1 49590 00 667.32 00
SAPG1 49611 00 781.03 00
SAPG1 49905 00 443.79 00
SAPG1 50205 00 883.56 00
SAPG1 50220 00 1315.15 00
SAPG1 50230 00 1638.74 00
SAPG1 50234 00 1666.16 00
SAPG1 50250 00 1566.14 00
SAPG1 50327 00 262.04 00
SAPG1 50541 00 1183.31 00
SAPG1 50620 00 1156.88 00
SAPG1 50650 00 1321.96 00
497 rows selected.
Just the inline view inline_data,
SQL> SELECT arc.schedule col1, arc.procedurecode col2, NVL (arc.modifier, '00') AS col3
2 FROM mpi_udffee.udffeeancfeedata arc
3 WHERE monthofextract = '201202'
4 AND arc.schedule = 'SAPG1'
5 AND TRUNC (SYSDATE - 10) BETWEEN arc.recordeffectivedate AND arc.recordterminationdate;
no rows selectedMuch unusual thing is when I just remove the case statement from the inline view "inline_fee", I am getting right results,
SELECT *
FROM (SELECT DISTINCT mf.schedule,
mf.cptcode,
NVL (mf.modifier, '00') modifier2 <-- Removed Case statement here
FROM provider.mpifee mf, mpi_udffee.udffeeactivecptcodes vld
WHERE mf.schedule = 'SAPG1'
AND mf.cptcode = vld.cptcode
AND NVL (mf.modifier, 'NULL') = NVL (vld.modifier, 'NULL')) inline_fee,
(SELECT arc.schedule col1, arc.procedurecode col2, NVL (arc.modifier, '00') AS col3
FROM mpi_udffee.udffeeancfeedata arc
WHERE monthofextract = '201202'
AND arc.schedule = 'SAPG1'
AND TRUNC (SYSDATE - 10) BETWEEN arc.recordeffectivedate AND arc.recordterminationdate) inline_data
WHERE inline_fee.schedule = inline_data.col1(+)
AND inline_fee.cptcode = inline_data.col2(+)
AND inline_fee.modifier2 = inline_data.col3(+);
SCHEDULE CPTCO MODIFIER2 COL1 COL2 COL3
SAPG1 46730 00
SAPG1 46735 00
SAPG1 46748 00
SAPG1 46760 00
SAPG1 46942 00
SAPG1 46945 00
SAPG1 47015 00
SAPG1 47125 00
SAPG1 47350 00
SAPG1 47505 00
SAPG1 47553 00interestingly explain plan for both the statements are exactly same,
SELECT STATEMENT ALL_ROWSCost: 138 Bytes: 1,078,274 Cardinality: 11,471
9 HASH JOIN RIGHT OUTER Cost: 138 Bytes: 1,078,274 Cardinality: 11,471
2 PARTITION RANGE EMPTY Cost: 2 Bytes: 150 Cardinality: 3
1 TABLE ACCESS FULL TABLE MPI_UDFFEE.UDFFEEANCFEEDATA Cost: 2 Bytes: 150 Cardinality: 3
8 VIEW MPI_UDFFEE. Cost: 135 Bytes: 504,724 Cardinality: 11,471
7 HASH UNIQUE Cost: 135 Bytes: 539,137 Cardinality: 11,471
6 HASH JOIN Cost: 134 Bytes: 539,137 Cardinality: 11,471
3 TABLE ACCESS FULL TABLE MPI_UDFFEE.UDFFEEACTIVECPTCODES Cost: 13 Bytes: 177,345 Cardinality: 25,335
5 PARTITION LIST SINGLE Cost: 120 Bytes: 600,600 Cardinality: 15,015 Partition #: 8
4 INDEX RANGE SCAN INDEX (UNIQUE) REPRICE.PK_MPIFEE Cost: 120 Bytes: 600,600 Cardinality: 15,015 Partition #: 9 Partitions accessed #11Is there anything wrong with the query? If not have anyone come across this issue or posted it as a bug or is there a patch?
Update:
when I set the parameter "_complex_view_merging"=false I am getting the right results even with case statement. But I don want to do some thing unsupported.
Are there any other viable solutions?
I appreciate the help.
Thanks,
G.
Edited by: Ganesh Srivatsav on Apr 10, 2012 12:37 PMHi Tubby,
Right, the query transformation is going wrong. Following is from trace,
SELECT "INLINE_FEE"."SCHEDULE" "SCHEDULE",
"INLINE_FEE"."CPTCODE" "CPTCODE",
"INLINE_FEE"."MODIFIER2" "MODIFIER2",
"INLINE_FEE"."FEE" "FEE",
"ARC"."SCHEDULE" "COL1",
"ARC"."PROCEDURECODE" "COL2",
CASE
WHEN "ARC".ROWID IS NOT NULL THEN NVL ("ARC"."MODIFIER", '00')
ELSE NULL
END
"COL3"
FROM (SELECT DISTINCT "MF"."SCHEDULE" "SCHEDULE",
"MF"."CPTCODE" "CPTCODE",
NVL ("MF"."MODIFIER", :B2) "MODIFIER2",
CASE
WHEN ("MF"."FEETYPE" = :B3
AND "MF"."MULTIPLIER" IS NOT NULL) THEN
:B4
WHEN ( ("MF"."FEETYPE" <> :B5
OR "MF"."FEETYPE" IS NULL)
AND "MF"."RBRVSVALUE" IS NOT NULL
AND "MF"."MULTIPLIER" IS NOT NULL) THEN
LPAD ( TRIM (TO_CHAR ( "MF"."RBRVSVALUE" * "MF"."MULTIPLIER" / :B6, :B7)), :B8)
ELSE
NULL
END
"FEE"
FROM "PROVIDER"."MPIFEE" "MF", "MPI_UDFFEE"."UDFFEEACTIVECPTCODES" "VLD"
WHERE "MF"."SCHEDULE" = 'SAPG1'
AND "MF"."CPTCODE" = "VLD"."CPTCODE"
AND NVL ("MF"."MODIFIER", 'NULL') = NVL ("VLD"."MODIFIER", 'NULL')) "INLINE_FEE",
"MPI_UDFFEE"."UDFFEEANCFEEDATA" "ARC"
WHERE "INLINE_FEE"."SCHEDULE" = "ARC"."SCHEDULE"(+)
AND "INLINE_FEE"."CPTCODE" = "ARC"."PROCEDURECODE"(+)
AND "INLINE_FEE"."MODIFIER2" = CASE
WHEN ("ARC".ROWID(+) IS NOT NULL) THEN NVL ("ARC"."MODIFIER"(+), '00')
ELSE NULL
END
AND "ARC"."MONTHOFEXTRACT"(+) = '201202'
AND "ARC"."SCHEDULE"(+) = 'SAPG1'
AND TRUNC (SYSDATE-10) >= "ARC"."RECORDEFFECTIVEDATE"(+)
AND TRUNC (SYSDATE-10) <= "ARC"."RECORDTERMINATIONDATE"(+)Does this refer to a specific bug?
Thanks,
G. -
'Missing select' error for update statement using WITH clause
Hi,
I am getting the below error for update statement using WITH clause
SQL Error: ORA-00928: missing SELECT keyword
UPDATE A
set A.col1 = 'val1'
where
A.col2 IN (
WITH D AS
SELECT col2 FROM
(SELECT col2, MIN(datecol) col3 FROM DS
WHERE <conditions>
GROUP BY PATIENT) D2
WHERE
<conditions on A.col4 and D2.col3>Hi,
The format of a query using WITH is:
WITH d AS
SELECT ... -- sub_query
SELECT ... -- main query
You don't have a main query. The keyword FROM has to come immediately after the right ')' that ends the last WITH clause sub-query.
That explains the problem based on what you posted. I can't tell if the real problem is in the conditions that you didn't post.
I hope this answers your question.
If not, post a complete test script that people can run to re-create the problem and test their ideas. Include a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Erased all content on 3G but now won't sync with iTunes. Error states, "This iPhone cannot be used because the Apple Mobile Device service is not started." I don't want phone service on this old 3G. Just want to use it as an iTouch. Any suggestions?
Type "Apple Mobile Device service " into the search bar at the top of this page by "Support"
-
Use Of "#EC CI_EXECSQL in ABAP with EXEC SQL. Statement giving Syntax Error
Dear Gurus,
I have encountered an issue while trying to remove warning for using Native SQL statement using pseudo comment "#EC CI_EXECSQL
The thing is like this -- i have used follwing native sql command in abap.
EXEC SQL.
CONNECT TO 'SURROUND_DB'
ENDEXEC.
Now when i am checking this code in code inspector it is showing a warning with information below
CA CL_CI_TEST_CRITICAL_STATEMENTS0006
Code Inspector
Critical Statements
Use of Native SQL
Authorization checks cannot be appropriately run using EXEC SQL and should be carried out at program level.
The message can be hidden using the pseudo-comment "#EC CI_EXECSQL
Use of exceptin handling section for that warning showing me to use :
The message can be hidden using pseudo
comment "#EC CI_EXECSQL
Now when I am using "#EC CI_EXECSQL in the abap like below :
EXEC SQL. "#EC CI_EXECSQL
CONNECT TO 'SURROUND_DB'
ENDEXEC.
It is giving syntax error
The text literal ""#EC CI_EXECSQL " is longer than 255
characters.Check whether it ends correctly.
Please provide the guideline to resolve this issue.
Thanks & regards
Saifur Rahaman.Hi Saifur,
You can remove the warning using the following syntax:
EXEC "#EC CI_EXECSQL
SQL.
CONNECT TO 'SURROUND_DB'
ENDEXEC.
At least, it worked fine for me when using OPEN CURSOR, SELECT, FETCH and so on statements.
The way to use the pseudo comment is not very intuitive, but at least for my examples worked fine.
I hope this may help you.
Best regards,
Edgardo G. König -
How to use Dynamic cascading parameter in crystal Report XI ?
Hi,
I want to use Dynamic cascading parameter in crystal Report XI which is to be viewed through the infoview without using the Business View.Is it possible?
I could implemented Dynamic cascading parameter using the CR XI developer without using Business View, but cannot view the report when uploaded it to BOXI, through infoview.
Please suggest..
Thanks in advance..
RajneeshIn the crystal reports field explorer>right click on parameter field>create new-->name the parameter field and select the type as dynamic. Now in the value field click the row and add the database field also add another field below that by clicking on the next row so..on. The order should be like this parent field first and then child field next...... Also click on the last column to add parmater for each level.
Regards,
Raghavendra -
CLOB with case statement not working getting error
Can anyone help on this
I write this sql
select Case when to_clob(PROPERTY) = 'is_intradesk=Y' then 'Internal' end
from JPM_CP;
Where PROPERTY column is clob column and its giving the error "ORA-00932: inconsistent datatypes: expected - got CLOB"
Is it not possible to use clob columns with case or decode !Its working but it does not fulfill my purpose
In you answer it is looking for position right! means, does the column contain the value('Intradesk=Y' ) or not. means
I am looking for exact match with CLOB column values, that is Clob column(PROPERTY) contains the exact value that value which I am comparing with i.e 'Intradesk=Y'
I need this
select * from table where clob_column = 'value' (exact).
Edited by: sajalkdas on Feb 4, 2011 3:28 PM -
Update statement with Case syntax
I want to put case statement in an update statement using Oracle 10g
I'm getting a syntax error on the last line Ora-00933: SQL command not properly ended
Help please
UPDATE EMP a
SET EMP.TYPE = CASE
WHEN 'Y' = 'A' THEN 'DIV'
WHEN 'Y' = '1' THEN 'DEF'
END CASE;Hi,
Samim wrote:
I want to put case statement in an update statement using Oracle 10g
I'm getting a syntax error on the last line Ora-00933: SQL command not properly ended
Help please
UPDATE EMP a
SET EMP.TYPE = CASE
WHEN 'Y' = 'A' THEN 'DIV'
WHEN 'Y' = '1' THEN 'DEF'
END CASE;The closing keyword that corresponds to "CASE" is "END", not "END *CASE* ".
The string 'Y' is never equal to 'A', or to '1'.
If you have a column named y in the table, then you might want to say:
UPDATE EMP
SET EMP.TYPE = CASE
WHEN Y = 'A' THEN 'DIV'
WHEN Y = '1' THEN 'DEF'
END;I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statemnts to re-create your emp table as it exists before the UPDATE), and the results you want from that data (that is, the contents of the emp table after the UPDATE). -
Hello,
I want to use case in update statement.
For example I have a table whose name is Item. There are 20 fields in this table. StockHoldType, Quantity and Amount are three of them.
I want to update quantity or amount fields according to stockholdtype fields value. If stockholdtype is 1 , I will update quantity field,
if stockholdtype field is 2 I will update amount field.
How can I do this?upadte table_name
set Quantity = decode(stockholdtype,1,+new_value+,quantity),
amount = decode(stockholdtype,2,+new_value+,amount)
where stockholdtype in (1,2) -
I wanted to use verizon hotspot wifi with my ipad (it searaches for hotspots when ur on the go) but verizon states not compatible with operating system. States that it needs windows 7, Vista, or windows XP. Any ways around this? Any ideas?
Thank you everyone for reaching out and apologize for being unclear. Let me rephrase. There is NO MiFi.
I have an ipad3 and a PC
I am trying to connect the iPad3 to the PC for HotSpotting reason (the ability to use the internet on the PC)
Turning on HOT SPOT on the Apple ipad works GREAT when using it through WI-Fi and through Blue Tooth. But connecting it directly through the included iPad 3 USB Cable to the USB side of the PC does NOT work. I tried several PCs, and several Cables. Any other ideas
Maybe you are looking for
-
I am owner of a rMBP mid 2014 13" and upgraded to OS X Yosemite last night, as Mavericks was prompting me to. I have since struggled with a problem: My cursor lags if I keep it still for a second and move it afterwards. It takes about half a second t
-
Oracle (OCI8) driver not available!
I have installed DAC successfully. So I start my client and am trying to create a new connection. I did the following: 1) Clicked Configure 2) by default, Create connection is selected, I clicked Next 3) Entered Name, selected Connection Type as Orac
-
Uninstalling PSE 7, 8, 9 and 10
I have PSE 7, 8, 9, 10 and now 11. My Norton diagnostics program reports I have too many prorgrams and should uninstall some. I did not uninstall PSE as I updated newer versions. If I uninstall 7 - 10, will I lose catalog files or otherwise do ha
-
How to change settings to view JPEG images?
I have a Gmail account and when I attempt to view Jpeg images on emails in a larger size I get a blank page with a crossed box in one corner . How can I change settings on my PC to view the images?
-
Hi there, I have never had issues with PSE 11 at all, nor PSE 9 prior to that. Suddenly, I am experiencing "fault bucket" errors and the "photoshop elements 11 has stopped working" error. It always occurs when I am accessing a plug-in; either a Top