Non Empty function in MDX with IIF command

Hi All ,
I have a MDX query like:
IIF(isgeneration([YEAR].CurrentMember, 2),
iif(isgeneration([TIME].CurrentMember, 4),
parallelperiod(YEAR.generations(2), 1, [YEAR].currentmember),
missing
missing
Now if I'm trying to write NON EMPTY function like:
IIF(isgeneration([YEAR].CurrentMember, 2),
iif(isgeneration([TIME].CurrentMember, 4),
+NON EMPTY(parallelperiod(YEAR.generations(2), 1, [YEAR].currentmember))+,
missing
missing
then it gives me syntax error.
Can you please help me how to write NON EMPTY function with IIF statement
Thanks in advance

Hi All,
Any help Please. I'm getting error not only within IIF statement but also in simple MDX query. As a example :
NonEmptySubset(
([Total Rev Measure], time.currentmember)
This also thrown syntax error. I have tried Non Empty also.

Similar Messages

  • Need to extract non empty value thru MDX

    Hi All,
    I have a requirement where there are 2 measures A and B.. I need to populate the first non-missing value from a layer from A in to B..
    tried using HEAD function however looks like in ASO MDX member formulas does not support this ..
    Any help would be highly appreciated
    Thnks,

    I believe the issue is that the formula you are using returns a set and you are looking for a value. Therefore, you need to use the Head function with a function that returns a numeric value (ie: Sum, Max, Avg, etc). In instances like this I typically use the Sum function. Depending on your cube and the rest of your formula, you may need to put some additional work into the formula so that the Sum returns just the value you need, but it just requires getting more specific in your arugments.
    The Head formula will bring back the first member or tuples specified, but won't evaluate for non-missing. You may need to also combine the Head forumla with the Filter formula. ex: Sum(Head(Filter([Dimension or Member].SetFunction,[A] <> Missing)),1) You will mostly need to select some other dimension to apply the filter to (like period or scenario). Examples of the SetFunction are Children, Members, Levels(0), etc. If you end up going this route you may want to write out your Sum(Head()) function and and Sum(Filter()) function and validate each independently and then merge. I find this helps when trying to build larger nested functions.
    Hope this helps!
    Jen

  • OBIEE: non empty cross join function problem with some reports

    Hi all,
    I am getting some problem ,when we are excuting some requests in OBIEE its taking long time , Actually our OBIEE is connected with Essbase when we are generating some reports its taking long time so i captured the Query in OBIEE and Iam excuting that query in Essbase MDX editor
    its having the the function " NON EMPTy CROSS JOIN"
    which reports having non empty crossjoin function its taking long time so how can i disable this function in OBIEEfor that reports
    I dont want to use that function for my reports so how can i do this in OBIEE
    your help would be appriciated.
    Thanks
    Edited by: user8815661 on 26 mai 2010 08:44

    Any Help

  • Create new object (measure) with IIF function on BW Olap universe:mdx error

    hello
    i have a universe based on a BEX query
    i want to create a new object (a measure) with the IIF(,,) function
    i created the following select:
    <EXPRESSION>IIF(@Select(Currency Type\CurrencyTypeCode)="10",@Select(Key Figures\RevenueGlobalCurrency),@Select(Key Figures\RevenueLocalCurrency))</EXPRESSION>
    defined as number
    where
    CurrencyTypeCode is a dimension (character format)
    RevenueGlobalCurrency and RevenueLocalCurrency are measure (number format)
    i always have a parse which is OK but
    when i want to  use the object on a webi report i always have an MDX error : ...invalid MDX with .... (WIS 10901)
    and advise ?
    Thanks

    Hi Didier,
    Thanks a lot for your help.
    Now it works : i do not understand why
    i explain:
    the correct syntaxe of my new measure is :
    <EXPRESSION>([Measures].[4FVLHG7OAJMNY9WC06X6JLOZQ], [0CURTYPE].[10])</EXPRESSION>
    it does not works with my "L01 currency type" BO dimension
    ([0CURTYPE].[LEVEL01])
    when i had :
    -my universe is based on a BW BEX query
    -my universe has been automaticaly generated with the assistant
    -the Currency Type Class was define as below:
           - 1 BO dimension object : L01 Currency Type =>
    [0CURTYPE].[LEVEL01]
           - 3 BO detail objects : L01 Currency Type techName =>
    [0CURTYPE].[LEVEL01].[TECH_NAME]
                                              L01 Currency Type Key =>
    [0CURTYPE].[LEVEL01].[[20CURTYPE]].[Value]
                                             L01 Currency Type Long Name =>
    [0CURTYPE].[LEVEL01].[[40CURTYPE]].[Value]
    i always had a wrong mdx syntax error on the webi report
    i updated the class with the follow
         - 1 BO dimension object : L01 Currency Type =>
    [0CURTYPE].[LEVEL01] (idem)
           - 3 BO detail objects : L01 Currency Type techName =>
    [0CURTYPE].[LEVEL01].[TECH_NAME]  (idem)
                                              L01 Currency Type Key =>
    [0CURTYPE].[LEVEL01].[NAME] (updated)
                                             L01 Currency Type Long Name =>
    [0CURTYPE].[LEVEL01].[DESCRIPTION] (updated)
    then it was working
    Then i tried to reproduce from scratch and now it also works with the previous version of the class.
    I do not understand anything
    Is there something like a cache file of the MDX query (in RSRT, cache mode is set to inactive for the bex query) ?
    ps: this is the same if a use webi under infoview (java) or webi rich client...
    Edited by: Frederic Nez on Jan 19, 2010 6:35 PM
    (edit : there is mistake in the post : objects are always between [] even if it is not dispay => change objects to code mode)

  • Plot empty point in line chart with previous non empty value

    Hello,
    I have a problem to plot series data in SSRS line chart, with the empty point, I don't want use average and zero provided by the report builder, I want use the last non empty data to fill the empty point, tried to use expression =Previous(Field!Value), no
    luck, any one have some good idea?
    P.S. do not want to use query to fill the null with previous non null value, just from the performance point view. at last , the chart should have some line as square wave with different height, if I use average for empty point, it shows slop wave line which
    is not reflect the real production.
    Thanks
    Richard 

    Hi Richard,
    In Reporting Services, if the chart type is a linear chart type (bar, column, scatter, line, area, range), null values are shown on the chart as empty spaces or gaps between data points in a series. By default, empty points are calculated by taking the average
    of the previous and next data points that are not null.
    If we want to use previous value to replace the empty value, please refer to the following steps:
    Right-click the field which displayed in Y axis (Height) to open the Series Properties.
    In the Value field to modify the expression to look like this:
    =iif(isnothing(Sum(Fields!Height.Value)),previous(sum(Fields!Height.Value)),sum(Fields!Height.Value))
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Report with two Command is empty if one of the two commands returns no data

    Hi all,
    I have a report with two Commands not linked together.
    If ONLY one of the two Commands returns no data, the full report is empty (although the other Command returns data).
    I'm using Crystal Report 2008 and the CRJ 12.2.205
    Have an idea?

    Hi Ted,
    how can I solve the problem, please? It is important.
    If I can help yourself, the problem is appeared in many reports since I updated the library (the old library version 11.8.4.1094 works fine with all). I'm waiting for your answer, please.
    Thank you very much.

  • Updating a DB table with only non-empty values of a work area

    Hi everybody,
    Is that possible in ABAP to update a table in the database with a work area, but only with non-empty values of this work area?
    Example:
    data: ls_custom type ZCUSTOMERS_0.
    ls_custom-CUSTOMER = '20'.
    ls_custom-LASTNAME = 'MyName'.
    ls_custom-FIRSTNAME = ' '.
    ls_custom-CURRENCY = ' '.
    update ZCUSTOMERS_0 from ls_custom.  *" I want that the update clause don't do the update with FIRSTNAME  and CURRENCY fields because they have empty values*
    If it's possible, how to do it?
    Thanks & regards,
    Abdel

    Total Questions:  81 (66 unresolved)
    Hi,
    To my understanding you mean if the database table has values
    customer         20
    lastname          somename
    firstname         firstname
    currency          INR
    so now after this
    data: ls_custom type ZCUSTOMERS_0.
    ls_custom-CUSTOMER = '20'.
    ls_custom-LASTNAME = 'MyName'.
    ls_custom-FIRSTNAME = ' '.
    ls_custom-CURRENCY = ' '.
    update ZCUSTOMERS_0 from ls_custom.
    you want the result as
    customer         20
    lastname          Myname
    firstname         firstname
    currency          INR
    Is it so? Then Normal update
    data: ls_custom type ZCUSTOMERS_0.
    ls_custom-CUSTOMER = '20'.
    ls_custom-LASTNAME = 'MyName'.
    update ZCUSTOMERS_0 from ls_custom.
    would do that.
    Thanks,
    Sri.

  • Mdx : Sum up the measure from start but need only non empty rows

    Hi All
    i have created a calculated measure where it suming up all its previous avaialable values based on Date dimension.
    Everything is working but we are getting all rows from that datetimension . how can get only till current date,
    SUM(NULL:[Date].[Hierarchy].currentmember,[Measures].[SIMID])
    Surendra Thota

    Hi Surendra,
    According to your description, you want to calculate the sum up the measure from start for those non empty rows, right?
    In this case, please try the query below.
    WITH MEMBER [Measures].[Sum from start]
    AS
    SUM ({NULL:[Date].[Calendar].CurrentMember},
    [Measures].[Internet Sales Amount])
    SELECT {[Measures].[Internet Sales Amount],[Measures].[Sum from start]} ON 0 ,
    nonempty([Date].[Calendar].[Calendar Year].MEMBERS) ON 1
    FROM [Adventure Works]
    Result
    Besides, here is a blog which describe various way to calculate running total, please see:
    http://blog.sqltechie.com/2011/01/various-way-to-calculate-running-total.html
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Calendar has been non-functional for hours, with small screen saying "Moving calendars to server account..." Help?

    Calendar on Mavericks MacPro has been non-functional for hours, with small screen saying "Moving calendars to server account..." How can I restore its function?

    Sorry. I found some other advice that solved the problem ere I saw your response.
    The advice was:
    Go to Finder. Holding "Option" key, find Library in "Go" pull down menu.   In Library. Select Calendars. To desktop, drag all files with the word "cache." Then go to Preferences (still in Library) and drag to desktop "com.apple.ical.plist".  Restart. Now Calendar is working perfectly, and rechecking under Library, the caches files and the com.apple.ical.plist  that were dragged to the desktop have reappeared in Calendars and Preferences.
    All is well. Many thanks for your reply! Sorry that I did not get to check it out.

  • Zipping a folder with empty and non empty subfolders

    Hello everybody there,
    Right now i am facing the difficulty to zip a folder which is having some empty and non-empty folders within it.
    Can anyone suggest me what to do.
    I want to do it with java.util.zip package

    Hello, Omke.
    I will follow your suggestion and try to request this feature for a future release of Bridge. One thing I thought was that perhaps this is something that could be accomplished with a script. I have seen a few interesting scripts in Adobe's Exchange web page, John Nack's web site and also on Peter Krogh's DAM useful web site. Some of the scripts I have seen on these sites perform tasks that are far more complex (or so they seem) than it would be to simply display the number of images next to each folder.
    Good point about what number to display. My folder hierarchy is quite simple. All I have is a main photos folder and inside this folder I have numerous others, each corresponding to a photo shoot/location. In my specific case the number next to each folder would correspond to the number of images in the folder not counting other files whether hidden or not (things like bridge cache, sidecar files and others would not be included in the number).
    How easy or difficult would it be to find someone experienced enough with Bridge scripting so as to suggest this project ? What would be the best place to post such a suggestion/request ?
    Thank you again for your reply and helpful answer.
    Best regards,
    Joseph

  • Error "Members, tuples or sets must use the same hierarchies in the function" in MDX

    the following MDX returns error: "Members, tuples or sets must use the same hierarchies in the function"
    WITH
    MEMBER [Measures].[Prev Year] AS
    [Measures].[returns],
    PARALLELPERIOD
    [Exec Date].[Year].Levels('Year'),
    1,
    [Exec Date].[Year].CURRENTMEMBER
    MEMBER [Measures].[Prev Month] AS
    [Measures].[returns],
    PARALLELPERIOD
    [Exec Date].[Month Num].Levels('Month Num'),
    1,
    [Exec Date].[Month Num].CURRENTMEMBER
    MEMBER [Measures].[Prev Day] AS
    [Measures].[returns],
    PARALLELPERIOD
    [Exec Date].[Day].Levels('Day'),
    1,
    [Exec Date].[Day].CURRENTMEMBER
    SELECT NON EMPTY { StrToMember("@ExecDateLevel"), [Measures].[returns] } ON COLUMNS, NON EMPTY { ([Employees].[Company].[Company].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM (
    SELECT (
    STRTOSET(@ExecDateHierarchy, CONSTRAINED)
    ) ON COLUMNS FROM [cbSales]) WHERE ( IIF( STRTOSET(@ExecDateHierarchy, CONSTRAINED).Count = 1, STRTOSET(@ExecDateHierarchy, CONSTRAINED), [Exec Date].[Hierarchy].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
    and when I replace "StrToMember(@ExecDateLevel)" with
    StrToMember("[Measures].[Prev Month]") the MDX is compiled correctly.
    what is the problem?
    How can I solve that?

    Hi Breceive,
    In your scenario, the issue is caused by that you select dimension members and measures on the same axis without a crossjoin.
    SELECT NON EMPTY {  StrToMember("@ExecDateLevel"), [Measures].[returns] } ON COLUMNS
    To avoid this issue, you can use the query below.
    WITH
    MEMBER [Measures].[Prev Year] AS
    [Measures].[returns],
    PARALLELPERIOD
    [Exec Date].[Year].Levels('Year'),
    1,
    [Exec Date].[Year].CURRENTMEMBER
    MEMBER [Measures].[Prev Month] AS
    [Measures].[returns],
    PARALLELPERIOD
    [Exec Date].[Month Num].Levels('Month Num'),
    1,
    [Exec Date].[Month Num].CURRENTMEMBER
    MEMBER [Measures].[Prev Day] AS
    [Measures].[returns],
    PARALLELPERIOD
    [Exec Date].[Day].Levels('Day'),
    1,
    [Exec Date].[Day].CURRENTMEMBER
    SELECT NON EMPTY { StrToMember("@ExecDateLevel")*[Measures].[returns] } ON COLUMNS, NON EMPTY { ([Employees].[Company].[Company].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM (
    SELECT (
    STRTOSET(@ExecDateHierarchy, CONSTRAINED)
    ) ON COLUMNS FROM [cbSales]) WHERE ( IIF( STRTOSET(@ExecDateHierarchy, CONSTRAINED).Count = 1, STRTOSET(@ExecDateHierarchy, CONSTRAINED), [Exec Date].[Hierarchy].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
    Here is a similar thread for you reference.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3c21d9a8-640d-4dde-bc76-08d1fcbb3a31/multiple-dimension-query?forum=sqlanalysisservices
    Regards,
    Charlie Liao
    TechNet Community Support

  • How can you run a command with elevated rights on a remote server with invoke-command ?

    I am trying to run a script on a remote server with invoke-command.  The script is starting and is running fine, but the problem is that it should be running with elevated rights on the remote server.  On the server where I start the invoke-command, my account has the necessary rights.
    The server were I launch the invoke-command is a W2K8 R2.  The remote box is a W2K3 with powershell v2.0 installed.
    When I launch the script on the remote-box from the command line, I don't get the access denied's.
    Is there a way to do this ?
    Thanks in advance

    The script that I want to run is to install the windows updates.  I get an access denied on the download of the updates.
    When I execute the script on an W2K8 box, (not remotely) and I run it with non-elevated rights, I get the same error.
    The script is running fine when it is launched on W2K3 box locally with a domain account that has local admin rights, or on a W2K8 R2 server with a domain account that has local admin rights, but with elevated rights.
    Thanks in advance for your help.
    #=== start script ====
    param($installOption="TESTINSTALL",$rebootOption="NOREBOOT")
    Function Show-Help
    Write-Host ""
    Write-Host "SCRIPT: $scriptName <installOption> <RebootOption>"
    Write-Host ""
    Write-Host "DESCRIPTION: Installatie van WSUS updates op de lokale server"
    Write-Host ""
    Write-Host "PARAMETERS"
    Write-Host " -installOption <[INSTALL|TESTINSTALL]>"
    Write-Host " -rebootOption <[REBOOT|NOREBOOT|REBOOT_IF_UPDATED]>"
    Write-Host ""
    Write-Host "EXAMPLE:"
    Write-Host "$ScriptName -installOption INSTALL -rebootOption REBOOT_IF_UPDATED"
    Write-Host "$ScriptNAme INSTALL NOREBOOT"
    Write-Host ""
    Write-Host "Indien beide parameter weggelaten worden zijn de defaultwaarden :"
    Write-Host " installOption=TESTINSTALL "
    Write-Host " RebootOption=NOREBOOT"
    Write-Host ""
    Exit
    #Include alle globale variablen
    $CEIF_WIN_PATH = (get-content env:CEIF_WIN_PATH)
    $includeFile=$CEIF_WIN_PATH + "\Scripts\include_win.ps1"
    . $includeFile
    #initialiseer error count
    $errcnt=0
    $scriptName=$MyInvocation.MyCommand.Name
    #argumenten controleren
    $arrInstallOption= "TESTINSTALL", "INSTALL" # Mandatory variable with predefined values
    If (!($arrInstallOption –contains $installOption)){ Show-Help }
    $arrRebootOption = "REBOOT", "NOREBOOT","REBOOT_IF_UPDATED" # Mandatory variable with predefined values
    If (!($arrRebootOption –contains $rebootOption)){ Show-Help }
    #Logfile opbouwen
    $logfile = get-logfileName($MyInvocation.MyCommand.Name)
    Log-scriptStart $MyInvocation.MyCommand.Name $logfile
    function Get-WIAStatusValue($value)
    switch -exact ($value)
    0 {"NotStarted"}
    1 {"InProgress"}
    2 {"Succeeded"}
    3 {"SucceededWithErrors"}
    4 {"Failed"}
    5 {"Aborted"}
    function boot-server()
    if ($installOption -eq "TESTINSTALL")
    logger "TESTINSTALL : - Reboot local Server" $logfile
    else
    logger " - Reboot local Server" $logfile
    $thisServer = gwmi win32_operatingsystem
    $thisServer.psbase.Scope.Options.EnablePrivileges = $true
    $thisServer.Reboot()
    $logmsg="Install option = " + $installOption + ", RebootOption = $rebootOption"
    logger "$logmsg" $logfile
    logger "" $logfile
    logger " - Creating WU COM object" $logfile
    $UpdateSession = New-Object -ComObject Microsoft.Update.Session
    $UpdateSearcher = $UpdateSession.CreateUpdateSearcher()
    logger " - Searching for Updates" $logfile
    $SearchResult = $UpdateSearcher.Search("IsAssigned=1 and IsHidden=0 and IsInstalled=0")
    logger " - Found [$($SearchResult.Updates.count)] Updates to Download and install" $logfile
    $Updates=$($SearchResult.Updates.count)
    logger "" $logfile
    foreach($Update in $SearchResult.Updates)
    if ($Update.EulaAccepted -eq 0)
    $Update.AcceptEula()
    # Add Update to Collection
    $UpdatesCollection = New-Object -ComObject Microsoft.Update.UpdateColl
    $UpdatesCollection.Add($Update) | out-null
    if ($installOption -eq "TESTINSTALL")
    else
    # Download
    logger " + Downloading Update $($Update.Title)" $logfile
    $UpdatesDownloader = $UpdateSession.CreateUpdateDownloader()
    $UpdatesDownloader.Updates = $UpdatesCollection
    $DownloadResult = $UpdatesDownloader.Download()
    $Message = " - Download {0}" -f (Get-WIAStatusValue $DownloadResult.ResultCode)
    if ($DownloadResult.ResultCode -eq 4 )
    { $errcnt = 1 }
    logger $message $logfile
    # Install
    logger " - Installing Update" $logfile
    $UpdatesInstaller = $UpdateSession.CreateUpdateInstaller()
    $UpdatesInstaller.Updates = $UpdatesCollection
    $InstallResult = $UpdatesInstaller.Install()
    $Message = " - Install {0}" -f (Get-WIAStatusValue $InstallResult.ResultCode)
    if ($InstallResult.ResultCode -eq 4 )
    { $errcnt = 1 }
    logger $message $logfile
    logger "" $logfile
    #Indien er een fout gebeurde tijdens download/installatie -> stuur mail naar windowsteam
    if ( $errcnt -gt 0 )
    logger " - Fout tijdens de uitvoering van script -> send mail" $logfile
    $mailSubject=$MyInvocation.MyCommand.Name
    $msg = new-object Net.Mail.MailMessage
    $att = new-object Net.Mail.Attachment($logfile)
    $smtp = new-object Net.Mail.SmtpClient($smtpServer)
    $msg.From = $mailFrom
    $msg.To.Add($mailTo)
    $msg.Subject = $mailSubject
    $msg.Body = “Meer details in attachement”
    $msg.Attachments.Add($att)
    $smtp.Send($msg)
    #Moet de server herstart worden ?
    if ($rebootOption -eq "REBOOT_IF_UPDATED" )
    if ($Updates -gt 0)
    #Reboot the server when updates are installed
    boot-server
    elseif ($rebootOption -eq "REBOOT")
    #reboot the server always
    boot-server
    else
    #Do not reboot the server
    logger "Do not reboot the server" $logfile
    Log-scriptEnd $MyInvocation.MyCommand.Name $logfile
    exit 0

  • Using Rank function in mdx

    I have the following data in my cube
    Prod ID  Account ID     Measure
    1            10                    20
    2            10                    20
    2            20                    10
    Now I want an mdx query which would show an aggregation against the Account ID 10 as 20 only and not 40 as the Account ID is the same which means the desired output has to be something like
    Account ID  Measure
    10                20
    20                10
    Note that Prod ID and Account ID are from different Dimensions.
    Please let me know how do I do this in MDX. Any help is greatly appreciated!!

    Hi N
    Another option is to use the Generate function and just take the last Prod Id for each Account.  Your MDX will look something like
    select non empty 
    {[Measures].[MyMeasure]
    } on 0, 
    non empty  
    generate([Account ID].[Account ID].[Account ID].members
    ,tail(nonempty([Prod ID].Prod ID].Prod ID]*[Account ID].[Account ID].currentmember,[Measures].[MyMeasure]),1))
    on 1
    from MyCube 
    Richard

  • Error -The trustAnchors parameter must be non-empty.

    Hi to all,
    i ve a send mail program, which i modified fm smtpsend.java,the sample come with javamail 1.4.3. this is working when i run from command prompt. but when i run this inside in jdeveloper 11g "the trustAnchors parameter must be non-empty" error is coming.
    i m using Weblogic Server 11g(10.3.2) & jdk6 update 16.
    Can anyone help me? wt is problem here?
    C:\Middleware11g2\jdk160_14_R27.6.5-32\bin\javaw.exe -client -classpath C:\JDeveloper\mywork\MyTestApp\classes;C:\JDeveloper\mywork\WorkFlow\javamail-1.4.3\javamail-1.4.3\mail.jar "-Djavax.net.ssl.trustStore=D:\Middleware11g 2\wlserver_10.3\server\lib\DemoTrust.jks" com.company.jsf.TestSmtp
    javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
    nested exception is:
    javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty.
    package com.company.jsf;
    import com.sun.mail.smtp.SMTPTransport;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.SendFailedException;
    import javax.mail.Session;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    public class TestSmtp {
    public TestSmtp() {
    super();
    public static void main(String[] args){
    String to="[email protected]", subject = "Hi", from = "[email protected]", cc = null, bcc = null, url = null;
    String mailhost = "smtp.gmail.com";
    String user = "myid", password = "mypassword";
    boolean debug = false;
    boolean verbose = false;
    boolean auth = true;
    String prot = "smtps";
    try{
    Properties props = System.getProperties();
    if (mailhost != null)
    props.put("mail." prot ".host", mailhost);
    if (auth)
    props.put("mail." prot ".auth", "true");
    // Get a Session object
    Session session = Session.getInstance(props, null);
    if (debug)
    session.setDebug(true);
    Message msg = new MimeMessage(session);
    if (from != null)
    msg.setFrom(new InternetAddress(from));
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
    if (cc != null)
    msg.setRecipients(Message.RecipientType.CC, InternetAddress.parse(cc, false));
    if (bcc != null)
    msg.setRecipients(Message.RecipientType.BCC, InternetAddress.parse(bcc, false));
    msg.setSubject(subject);
    String text = "hr u?";
    msg.setText(text);
    SMTPTransport t = (SMTPTransport)session.getTransport(prot);
    try {
    if (auth)
    t.connect(mailhost, user, password);
    else
    t.connect();
    t.sendMessage(msg, msg.getAllRecipients());
    finally {
    if (verbose)
    System.out.println("Response: " + t.getLastServerResponse());
    t.close();
    System.out.println("\nMail was sent successfully.");
    catch(Exception e){
    e.printStackTrace();
    Edited by: user7895 on May 20, 2010 12:47 AM

    Hi,
    is this topic *"Customizing JSSE-The Installation Directory <java-home>"* enough or there is something more? bz it's not a small doc, worthless to read whole, i believe.
    i ll appreciate if u specify related topics, other than above.
    thanks with regards
    Edited by: user7895 on May 20, 2010 11:44 AM
    Edited by: user7895 on May 20, 2010 11:45 AM

  • Implementing the Last Non Empty

    Dear All,
    I am trying to get the last non empty set by applying the Last Non Empty property to the measures Projectedvalue and Gross amount.  The below is the original table.
    The output I want is as below:
    For the Revised Quarter type Original all the recent values of the Projected quarter should be displayed.
    As you can see the last value for Q1 needs to be selected which is shown in above pic.
    Currently the cube output is same as the original table. :(
    Can anybody help me on this?
    Thanks, Franco.

    Hi Franco,
    In SQL Server Analysis Services (SSAS), LastNonEmpty is an aggregation function available in the Enterprise version of SQL Server. Essentially, you simply create a calculated member that returns the non empty value, or if empty, it looks in the previous
    member. Please take a look at the articles regarding Last Ever Non Empty.
    Getting the last non empty value
    The Last Non Empty Dilemma
    Last Ever Non Empty – a new, fast MDX approach
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • Pictures not loading in messages since update?

    Since the update I have been unable to view any pictures that have been sent to me in a message. The picture appears in the message as normal, but when I tap it I just get a loading screen that continues indefinately. Is there anything I can do to fi

  • System Freezes with Seagate 120Gb HDD

    I have recently tried to get an Apple certified technitian install a Seagate 120GB 5400rpm drive in my 15" AL-Powerbook 1.25GHz FW800. The system seems to boot but quickly freezes the computer. The same seemed to happen when booting from the same dri

  • Can I upload dvd to mac from portable dvd writer?

    I have a MacBook Pro running 10.9.4. I have a DVD of an old high school football game that I want to make copies of.  No drive in the MacBook Pro of course.  I have an LG slim portable DVD writer. Can I use this to upload the DVD to my Mac and then b

  • Fetching ename who are all having max(sal) in each of job from emp table

    hi all, i need a query to fetch all the ename who are all having maximum salary in each job category from emp table thankx in advance regrds, punith

  • How to make Safari content remain one consistent size?

    Hello, I just upgraded to Mavericks on my almost-new MacBook Pro with Retina display, and my almost-new iMac. (I upgraded from Mountain Lion). Here is a problem I've come across, and I have looked everywhere and can't seem to find a way to fix it. Wh