MDX Help!!!

Hi All,
I need your help to convert the below BSO outline formulae to MDX so that it can be migrated to ASO.
IF (@ISUDA(Time,"Future") AND @ISMBR(Actual,"Budget Variance","Forecast Variance"))
     #MISSING;
ELSEIF (@ISMBR(Actual,Budget,Forecast))
     IF (@ISLEV(Time,1))
          IF (@ISMBR(@MATCH(Time,"FY??.Q1")))
               $PLB - @PRIOR($PLB->Actual,1,@LEVMBRS(TIME,1));
          ELSE
               $PLB - @PRIOR($PLB,1,@LEVMBRS(TIME,1));
          ENDIF
     ENDIF
ELSEIF (@ISMBR("Budget Variance"))
     IF (@ISUDA("GL Account","VARCALC"))
          Budget - Actual;
     ELSE
          Actual - Budget;
     ENDIF
ENDIF
Thanks in advance

Hi S,
I think you can simply multiply Customer by State, filter based on counting Cities using your nonempty (or nonzero) measure, then extract the Customers.
Ie
with set MyCustomers as
extract(
filter( 
Filter(Customers.Customer.Customer 
*Geographic.State.State
,Measures.MyValue>0) 
,count(nonempty(Geographic.City.City,Measures.MyValue))>1)
,Customers.Customer)
select
{Measures.MyValue}
on 0,
MyCustomers
on 1 
from MyCube
Richard

Similar Messages

  • MDX - Help with IIF syntax

    I have a member in Accounts named 'Marketing' that needs a MDX formula with this logic:
    If the current member in the Market dimension is an idescendant of 'Total_Markets'
    Then
    [Corp_Level] * ( [Sales] / ( [Sales] , [Total_Markets] ) ) , [Corp_Level] )
    Else
    Just return the current value in 'Marketing'.
    I'm trying:
    IIF ( [Market].CurrentMember IS [Total_Markets].Descendants,
    [Corp_Level] * ( [Sales] / ( [Sales] , [Total_Markets] ) ) , [Corp_Level] ) , [Marketing] )
    Getting this error... I'm probably way off.....
    Error(1260052) - Syntax error in input MDX query on line 1 at token 'Descendants' Marketing

    Glenn,
    I tried that yesterday. There is absolutely no help anywhere on how to properly format my query. I must include 'basis' in my MaxL somehow and I couldn't find a single example of how to construct the MaxL properly. I'm so frustrated as I understand MaxL and CrossJoin but the link you sent is just not resonating for whatever reason. Here's my atttempt at that.
    login 'admin' 'epmtestdrive' on localhost;
    execute allocation process on database ASOAlloc.ASOAlloc with
    pov "Crossjoin(Descendants([Year],[Year].levels(0)),
    Crossjoin(Descendants([Product],[Product].levels(0)),
    Descendants([Scenario],[Scenario].levels(0))))"
    amount "([Corp_Level])"
    /* amount "([Sales],[Total_Markets])" */
    target ""
    range "([Marketing] )"/* ,[Payroll],[Miscellaneous])" */
    /* range "CrossJoin({[Marketing],[Payroll],[Miscellaneous]},
    Descendants([Total_Markets],[Market].levels(0)))" */
    basis           "([Sales], [Total_Markets])"
    share;
    logout;

  • IIF(ISEMPTY is Filtering out data MDX help

    Hi I am using the following MDX query which brings back the correct result but runs slow
    With MEMBER [Measures].[Tracker Task Completed] AS
    Aggregate(
    Generate
    (Existing [Date Primary Date].[Year - Month - Date].[Date]
    {(Linkmember
    [Date Primary Date].[Year - Month - Date],
    [Date Tracker Tasks Created].[Year - Month - Date]
    [Date Primary Date].[Year - Month - Date].[ALL])},ALL),
    [Measures].[FACT TRACKER TASK COUNT]
    select non empty [Measures].[Tracker Task Completed] on 0
    ,non empty [People Primary Feeearner].[People_Structure].[Fee Earner Name] on 1
    from [Prod_Cube]
    where ([Tracker Tasks].[Task_Type].[Task Type].&[File open],
    {[Date Primary Date].[Year - Month - Date].[Date].&[20130924],[Date Primary Date].[Year - Month - Date].[Date].&[20130925],[Date Primary Date].[Year - Month - Date].[Date].&[20130926]}
    To speed up the query I use the following in the calculated member
    With MEMBER [Measures].[Tracker Task Completed] AS
    IIF(ISEMPTY([Measures].[FACT TRACKER TASK COUNT]) = TRUE ,NULL,
    Aggregate(
    Generate
    (Existing [Date Primary Date].[Year - Month - Date].[Date]
    {(Linkmember
    [Date Primary Date].[Year - Month - Date],
    [Date Tracker Tasks Created].[Year - Month - Date]
    [Date Primary Date].[Year - Month - Date].[ALL])},ALL),
    [Measures].[FACT TRACKER TASK COUNT]
    However it would appear that this is filtering some of the data.
    but what is really strange is that is if I remove the
    [People Primary Feeearner].[People_Structure].[Fee Earner Name]
    so just tracker task completed value shows, the correct value will show with and without the IIF(isempty
    How can I resolve this?
    Best Regards

    Hi A,
    The reason the query is quite slow, is that it has to perform the calculation for every Fee Earner Name. Each calculation is a little expensive as it will need to look up the [Date Tracker Tasks Created] for the 3 dates every Fee Earner Name.
    You query would run a lot faster if you could add some predicates to limit the number of Fee Earner Names. For example, if you have 100,000 Names, but only half have [Measures].[FACT TRACKER TASK COUNT], then simply adding a NonEmpty() or Filter() on [Measures].[FACT
    TRACKER TASK COUNT] will cut the cost by about 50%. Note, the NonEmpty will only look at the [Date Primary Date] members in your where clause, so a Filter() function might be more appropriate as you could open the scope on [Date Primary Date], and
    hopefully narrow the scope based on other dimensions/measures. If you could filter down the Names from 100,000 to 1,000, the query will run neary 100 times faster.
    Hope that helps,
    Richard
    Thank for the suggestion Richard, what I eventually ended up doing was creating a extra layer within the ETL process so it would duplicate the rows but not double count them
    kinda of like this - all this just so it would work in PerformancePoint and the time intelligence filter

  • MDX help needed

    Hi,I have written an MDX query to extract data from Essbase. I am using CrossJoin function for the data to be displayed in Rows from 2 dimensions.The members are displaying seperated by a comma. How to display members with out a comma ? I need the data to be displayed in 2 columnsFor ex: the data now displaying as (100-10, Pepsi). I need 100-10 in one column and pepsi on other column. Could any body please send a sample MDX Query ?

    Hi All
    i have ceated the below measure
    CREATE SET CURRENTCUBE.[BICS SR Egress Set]
     AS (
      [Application].[Application].&[S6a/S6d]
            ,{[Egress Peer Origin Host].[Hierarchy].[Egress Host Group].&[BICS].children}
    CREATE MEMBER CURRENTCUBE.[Measures].[BICS SR Egress]
     AS IIF([Measures].[SuccessRate] > 0
    , sum
     [BICS SR Egress Set]
     ,[Measures].[SuccessRate]
    ,null)
    FORMAT_STRING = "Standard",
    VISIBLE = 1 ,  ASSOCIATED_MEASURE_GROUP = 'DRA Rate Count'  ;
    The problem here i am getting the  if we have more than 1 childs in a BICS group then it is SUMing up the Successrate.
    if you see the below snap shot at the highlihted part  count is 3  and 1 and succeesrate is 1 and 1 we need to get[BICS SR Egress] as same successrate but we are getting summned due to aggregate function ,
    Surendra Thota

  • Display two members of same dimension hierarchy using mdx on 2 diff columns

    Hi,
    Is it possible to print the parent of a member that belongs to a certain level in the hierarchy. For this example, the Dimension hierarchy is a Variable hierarchy based on a Row Source, - BOM - Bill of Materials.
    Let say there is a BOM hierarchy with 4 levels.
    Finished Good - Comp1 - Comp2 - Comp3.
    Then we want to display in the IOP report as follows.
    Finished Good Supply Chain--These are the column headers
    Finished Good1 Finished Good1
    Comp1
    Comp2
    Finished Good2 Finished Good2
    Comp3
    Comp4
    Comp3
    Edited by: user596497 on Mar 16, 2011 1:39 PM

    The question is wrong ...
    MDX helps you to construct cross-product of indices for the underlying cube and then it tells the system to find whether there is any cell with that index, and if so, returns a value for that combination.
    If you put two dimensions next to each other, what does it mean? There is no such combination in the underlying cube as each dimension is uniquely represented. We will throw an error as follows:
    You cannot mix-up display semantics with the syntax/semantics of MDX.
    "Can only cross join sets with different dimensions Statement"
    An internal error occurred during the query execution phase. Please contact your administrator.
    Query Definition
    WITH SET [AnotherGeography] AS '{[Geography].DefaultMember}' SELECT {Fiscal.DefaultMember} ON COLUMNS, { CrossJoin( {[Geography].DefaultMember}, {[Customers].DefaultMember}, {[AnotherGeography]}, {Hierarchize(Descendants([Product].DefaultMember, [Product].[Product Family], SELF_AND_BEFORE), POST) }, { [Measures].[Target Revenue], [Measures].[Demand Plan Revenue], [Measures].[Market Share], [Measures].[Adjusted Demand Plan Quantity] }) } ON ROWS FROM [Demand]
    Can only cross join sets with different dimensions Statement: WITH SET [AnotherGeography] AS '{[Geography].DefaultMember}' SELECT {Fiscal.DefaultMember} ON COLUMNS, { CrossJoin( {[Geography].DefaultMember}, {[Customers].DefaultMember}, {[AnotherGeography]}, {Hierarchize(Descendants([Product].DefaultMember, [Product].[Product Family], SELF_AND_BEFORE), POST) }, { [Measures].[Target Revenue], [Measures].[Demand Plan Revenue], [Measures].[Market Share], [Measures].[Adjusted Demand Plan Quantity] }) } ON ROWS FROM [Demand]

  • Help in Mdx query

    Consider below is the dimesion
    Evry project will have one last project id which is projectid only
    Project id  Last ProjectID
    1                   4
    2                   6
    3                  null
    4                  null
    5                  null
    6                  null
    below if the fact
    projectid Amont
    1              100
    2               200
    3                300
    4                 500
    I need calculated measure to get amount of corresponding last project id for each project
    When I use column Project id -> for project id 1 my calc measure  shud give me 500
    I can not calculate it in DSV.
    I need to calculate it with MDX only
    I tried taking last project id member value and pass as string to project id member -- but its not working
    Can any one please help in writing MDX exp for the same

    Hi ,
      Please try the below calculated measure 
    sum(StrToMember(" [Dim Project].[Project ID].&[" + [Dim Project].[Last Project ID].Currentmember.member_caption + "]" ),[Measures].[Amount])
    Best Regards Sorna

  • Help rerading the MDX query

    <p><span style=" font-family: Verdana;">Hi Gurus,</span></p><p> </p><p><span style=" font-family: Verdana;">I am</span> <span style=" font-family: Verdana;">at a learning stage to learn the MDX query.Could anyone help me with some link or book from where i can getthe syntax of some function with examples to understandthem.</span></p><p> </p><p><span style=" font-family: Verdana;">thanks</span></p><p> </p><p> </p>

    2 good books are MDX Solutions Second Edition, by George Spofford. This is a very good book, in depth, with a lot of material. George Spofford is also a regular contributor to this site, so if you have questions about any of the material, you could post here and he has proven to be very good about responding to questions.<BR>Another good book is Fast Track to MDX. This is also a good book. It's a quicker read and a little easier to get through then MDX Solutions, but the concepts are more fundamental and not as in depth, I think both books are worth reading.<BR>Other than that, there is a lot of material on this site, tech guides, white papers, etc that should be useful too.<BR><BR>HTH

  • Help for an function MDX AVG into a formulas

    Hi,
    I'm novice to build the MDX formulas. I need some help to build a formulas on a member of the account dimension.
    I have tow dimensions : Age and Year of Service.
    I want a formulas to calculate the "Average Age" and "Average Year in Service" with the "Head Count" of Account dimension.
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    25 and under
    26 to 35
    36 to 45
    46 to 55
    56 to 65
    Over 65
    Age by Decade
    Age
    0 Year(s)
    1 Year(s)
    2 Year(s)
    3 Year(s)
    4 Year(s)
    51 Year(s)
    52 Year(s)
    53 Year(s)
    54 Year(s)
    55 Year(s)
    56 Year(s)
    57 Year(s)
    58 Year(s)
    59 Year(s)
    No Years of Service
    Years of Service
    Thanks for your help.
    Edited by: user5423712 on 2 nov. 2009 12:54

    Hi garycris,
    I try that +AVG([Age].Levels(0).Members, [Accounts].[Head Count])+
    The result is not good.
         Head Count     Age in Years
    16     1     123
    17     1     123
    18     9     123
    19     28     123
    20     65     123
    21     84     123
    22     92     123
    23     147     123
    24     199     123
    25     189     123
    25 and under     815     123
    26 to 35     1973     123
    36 to 45     1803     123
    46 to 55     1698     123
    56 to 65     583     123
    Over 65     16     123
    Age by Decade     6888     123
    Age by Generation     6888     123
    Age     6888     123

  • MDX formula help

    The formula below works just fine but I want to use a UDA driven member in Member Range and need help.
    IIF(
    Count(
    Intersect(
    {MemberRange( [Jan],[Apr] )},
    {[Time].CurrentMember}
    ) = 1, [Actual], [Forecast])
    I tried with
    IIF(
    Count(
    Intersect(
    {MemberRange( [Jan],UDA([Period],"CurrMonth") )},
    {[Time].CurrentMember}
    ) = 1, [Actual], [Forecast])
    but I get an error Error(1260052) - Syntax error in input MDX query on line 4 at token ')' CalcMbr
    not sure why is this not working - I think UDA() can result in a set but member range is expecting a member only??
    Please suggest any ideas to correct the code.

    also tried with {[Jan]:UDA([Period],"CurrMonth")}
    instead of {MemberRange( [Jan],UDA([Period],"CurrMonth") )} - but no luck
    Any suggestions?

  • Need help regarding complex calculation using Max value and limiting data after Max date in MDX

    I am working on a bit complex calculated measure in SSAS cube script mode.
    Scenario /Data Set
    Date
    A
    B
    C
    A+B
    5/29/2014
    Null
    34
    Null
    34
    6/30/2014
    Null
    23
    45
    68
    7/15/2014
    25
    -25
    Null
    0
    8/20/2014
    -34
    Null
    Null
    -34
    9/30/2014
    25
    Null
    60
    25
    10/15/2014
    45
    -45
    Null
    0
    11/20/2014
    7
    8
    Null
    15
    a) Need to capture latest non-null value of Column C based on date
    with above example it should be 60 as of 9/30/2014
    b) Need to capture column A+B for all dates.
    c) Add values from column (A+B) only after latest date which is after 9/30/2014. 
    with above example it's last 2 rows and sum is 15
    d) Finally add value from step a and step c. which means the calc measure value should be = 75
    I need to perform all this logic in MDX. I was able to successfully get step a and b in separate calc measure, however i am not sure how to limit the scope based on certain date criteria. In this case it's, date> Max date(9/30/2014) . Also how should
    i add calculated members and regular members?
    I was able to get max value of C based on date and max date to limit the scope.
    CREATE MEMBER CURRENTCUBE.[Measures].[LatestC] AS
    TAIL( 
      NONEMPTY(
        [Date].[Date].CHILDREN*[Measures].[C]),1).ITEM(0) ,visible=1;
    CREATE MEMBER CURRENTCUBE.[Measures].[MaxDateofC] AS
    TAIL( 
      NONEMPTY(
        [Date].[Date].CHILDREN,[Measures].[C]),1).ITEM(0).MemberValue ,visible=1;
    Please help with Scope statement to limit the aggregation of A+B for dates > MaxDateofC? Also further how to add this aggregation value to LatestC calc measure?
    Thank You

    Hi Peddi,
    I gave TRUNC to both of the dates. But still the same issue. I think the problem is in returning the BolbDomain.
    return blobDomain;
    } catch (XDOException xdoe) {
    System.out.println("Exception in XDO :");
    throw new OAException("Exception in XDO : "+xdoe.getMessage());
    catch (SQLException sqle) {
    System.out.println("Exception in SQL :");
    throw new OAException("SQL Exception : "+sqle.getMessage());
    catch (OAException e) {
    System.out.println("Exception in OA :");
    throw new OAException("Unexpected Error :: " +e.getMessage());
    Thanks and Regards,
    Myvizhi

  • Help in creating MDX Calculated Member using attributes from multiple Dimension

    Hi All,
    First of all my knowledge on MDX is basic. In one of our projects, there is a requirement to create calculated member (similar to derived fields in SQL) which is more of a dimension attribute and not really a calculated member. Due to IP issues I cannot paste
    the actual queries but I will provide an SQL Query equivalent to what I am trying to achieve:
    Select P.Product, Case When ISNULL(FS.ArtistName,'') = '' Then P.ArtistName Else FS.ArtistName End Artist
     From
    dbo.FactMusicSales FS
    Join dbo.dimProduct P
    on P.DimProductKey =  FS.DimProductKey
    We are trying to replicate the logic for derving the "Artist" field using MDX script.
    We are running into issues while trying to build an MDX expression using the above logic. The main issue being that the new field/member "Artist" would not be calculated unless its elements are selected (FS.ArtistName, P.ArtistName). Besides this
    we are also unable to place this new member in a different folder other than a sub folder under the measures. Any pointers to solving this would be really helpful.
    Thanks in Advance,
    Venki

    Hi Venki,
    According to your description, you need to create calculated member (similar to derived fields in SQL) which is more of a dimension attribute and not really a calculated member, right?
    In your scenario, you needn't to achieve this requirement by using MDX. You can use a named query on your data source view. A named query is a SQL expression represented as a table. In a named query, you can specify an SQL expression to select rows and columns
    returned from one or more tables in one or more data sources. So in you scenario, you can use your query on the DSV, and then use the modified table to create a dimension.
    http://msdn.microsoft.com/en-IN/library/ms175683.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • URGENT Help: Converting JAVA ALE API (9.3)  to MDX API (11.1.1)

    Hi All,
    currnetly I am in the process of converting ALE to MDX API as ALE is no more used
    com.hyperion.ap.IAPMdMember in ALE Api gives the member details like Alias, level, Gen etc
    Equivalent to IAPMdMember , In MDX there are two
    1.com.essbase.api.metadata.IEssMember -> It gives all the member details like Alias, level, Gen etc
    IEssMember metatdata extraction is very slow. need to increase maxport user as Goodwin said.Even then for 10 lakhs metadata it fails at one point or other (Using outline or member selection every thing fails)
    SEVERE: Cannot get members. Essbase Error(1007165): Cannot obtain new member handle.  The maximum number of open member handles for this outline has been reached.  You must save and close the outline to continue
    2. com.essbase.api.dataquery.IEssMdMember - It gives members Name/alias based on Query setting and some properties like readonly etc.
    This IEssMdMember metadata extraction is very fast. Even 10 lakhs data is retrieved ina minute, but I am in need of Alias, level and Gen to frame the metadat as Nodes (or in bean object with same hierarchy)
    can some Java MDX experts help me.Is there any to access member details like geb, level, alias using IEssMdMember? I searched in API i couldnt find any clue. converting IEssMdMember to IEssMember using outline findmember also time consuming and it taking 2 to 3 days to fetch the 10 lakhs record.
    If there is no way to get details , then give me some tips how it can be managed, by cache technology or threading or is there any fastest collection object available

    Add the below DIMENSION properties in MDX query will provide the Gen_Number, level and alias
    DIMENSION PROPERTIES MEMBER_ALIAS ,GEN_NUMBER ,LEVEL_NUMBER,MEMBER_NAME on columns
    Thanks for http://www.network54.com/Forum/58296/

  • Need some help with MDX formula

    Hello, I am not finding any good documentation on MDX formulas, there is a specific one that I need some help with....could someone please elaborate what exactly does this formula mean? thanks.
    (MEASURES.[SIGNEDDATA],
    CLOSINGPERIOD([%TIMEDIM%].
    [%TIMEBASELEVEL%]))

    If new MEASURE gets added to Measure's table , in BPC Client , etools->client Options-> Refresh Dimensions should get the new measure into the CurrentView .IF not try  etools->client Options-> Clear Local application information .
    Formula 2 : 
    (MEASURES.SIGNEDDATA,
    CLOSINGPERIOD(%TIMEDIM%.
    %TIMEBASELEVEL%))
    This formula is used to retrieve AST & LEQ account values.
    If current time member is at monthlevel ,ie  ClosingPeriod of  2011.FEB is  the current member it self ,and would retrieve 2011.FEB value.
    If Current time member is at quarter level then ClosingPeriod of 2011.Q1 is 2011.Mar  ,and would retrieve 2011.MAR value.
    If Current time member is at year level then ClosingPeriod of 2011.TOTAL is 2011.DEC  ,and would retrieve 2011.DEC value.
    Formula 1 :
    MEASURES.SIGNEDDATA
    Irrespective of the level of the Time , MEASURES.SIGNEDDATA would retrieve current Time member value.This formula is used to retrieve INC & EXP account values
    if current time member is at month level,2011.FEB , 2011.FEB value is retrieved.
    if current time member is at quarter level,2011.Q1 , 2011.Q1(JANFEBMAR)  value is retrieved.
    if current time  member is at year level,2011.TOTAL , 2011.TOTAL(JAN,FEB,....,DEC)  value is retrieved.
    Hope this helps.

  • MDX Hierarchy Help

    Hi,
    I want to extarct the hierarchy underneath [LEVEL01, I am writting a following mdx query but it gives my the result of all the nodes under LEVEL01 whereas I want to extract only specific (lets assume A) under [LEVEL01], has anybody worked on extracting hierarchies from mdx.
    SELECT
    [Measures].MEMBERS ON COLUMNS,
    [[0PROFIT_CTR                   UK  BW1].[LEVEL01].MEMBERS ON AXIS(1)
    FROM ZCP_CUBE/ZORB_1
    SAP VARIABLES [0S_SHIPT] INCLUDING " "
    Thanks for the help.
    Regards
    SS

    hi,
    try
    SELECT
    [Measures].MEMBERS ON COLUMNS,
    [[0PROFIT_CTR UK BW1]<b>.[A]</b> ON AXIS(1)
    FROM ZCP_CUBE/ZORB_1
    SAP VARIABLES [0S_SHIPT] INCLUDING " "
    transaction mdxtest can help in syntax, by drag the object name,  choose the cube and query name, all available objects -dimensions (incl. 'hierarchies','properties' ), key figures, variables, functions etc

  • ASO help with MDX

    We have recently upgraded from 9.3.1 to 11.1.1.3, and my MDX formula no longer works. Any help/input would be appreciated.
    Original Formula that worked in 9.3.1:
    Sum(CrossJoin({[PAT_DAY_NUM]}, {[DAY 1]:[DAY 2]}))
    If I write it like this in 11.1.1.3 it works (replacing the : with a ,):
    Sum(CrossJoin({[PAT_DAY_NUM]}, {[DAY 1],[DAY 2]}))
    As you can see I'm summing across a range of days and I have several nested statements like this depending on the day. Did something change in this release? I can't find anything about this and am working on a fix before we upgrade Production.
    Thanks!

    Yep, that's the confusion. The statement with the ':' results with nothing, but the statement changed to use a ',' provides the correct value.
    Thanks for the reply and I'll keep digging!

Maybe you are looking for

  • Mail app wont automaticaly fetch mail

    Hi everyone I have configured my business mail account which is based on a Microsoft Exchange  365 Server. Inbox including subfolders got synchronized without any issues. My problem is that if i dont click on the subfolders the new emails on each sub

  • It gives me an error when trying to put in payment information- how can i fix this and quick?

    I keep trying to purchase some music on iTunes and it takes me to the payment page. I enter in my correct address and payment information and it says my address is not valid. I just made a purchase in December and didn't have issues. can anyone help

  • Meeting.ics wont open or can't be accepted with iPhone 4

    Hi All, Had iOS5 for some time now. I previously was able to send outlook invites from my work account to my personal hotmail, see them as a full detailed invitation (time, date etc) and it also usually came in with a meeting.ics attachment. Since mo

  • How do I put an outline border around a table i.e. without internal borders being displayed?

    Hi I'd appreciate some help with putting a border around a table as I'm sure I'm not doing this the best way! I selected my table then chose a thin (size 2) border and desired colour. The problem is this has put a border around every cell in the tabl

  • Embed HTML Code Into Mail?

    Hi, Is it possible to embed HTML code into an Apple Mail message? If it isn't, this would be a really useful feature. Lots of sites now, such as YouTube and Flickr, provide snippets of HTML code that you can copy and paste into your "webpage". But ho