Charactersitic values to be used in IFTHEN ELSE STATEMENT IN QUERY

scenario: i need to use the characteristic values(not the attributes) to be used in an IF THEN ELSE STATEMENT in query. so i created a formula variable for the characteritic of processing type replacement path, replace with key.The values are not fetched in the result and is displayed as X.
what should i replace with key,lable, constant or other options whereas  my requirement is the all the values present in the characteristc should be used.
eg. if char name is xyz and has the values 1,2,3,4,5 till -
20.
then in a calculated key figure :(formulavariable =1)* kefig1keyfig2 +not(formulavariable =1)kef2keyfig3.
this formula variable should have all the values of the characteristic values ie 1,2,3---20.
2. how should i do get the values of characterstics values in the equation give me the steps in detail..
3. i do not want to use the attributes, though i tried initally while creating the formual variable i replaced with attribute value, there is was an error and there were no reult.
i tried to create char. variable  for the characteristic  of manual entr , not ready for input values and gave all the values 1,2,3 --20 as default values and then created formaul variable and repalce with the variable, however this characteristic variable is not at all displayed from the list of variables which will be displayed while creating the formula variable.
help me out.
Thanks

hi srini,
i have includedthe char in rows. i want you to explain in detail how to use these values in the if then else statement in query.
i have created a calculated key figure 2= (formual variable =1 & keyfig a =0)* keyfig1kefig2 +not(formual variable =1 & keyfig a =0)keyfig2 *calculated keyfig1.
so this formula variable of replacement path have ref. to then char. and with what value should it replace, key, name, external char or attribut etc so that i should get the values of the char from 1 to20.
i donot to repalce with the attribute. i just want the char. values and not thier attributes (1. description 2. the second attribute has the values say abc1,efg2,ghi3 for respective charteristic values.
ie
char value               desc                 2nd attrib
1                            hi                     abc1
2                            bye                  defg2
3                            ciao                  ghi3

Similar Messages

  • How can I use an IF ELSE statement and the xdoxslt: get_variable together?

    First of all, I'm a big fan of this forum and I just want to thank the community for helping make the BI Publisher world a better place.
    I'm trying to populate a table with a years worth of data with the column=PRODUCT and row=month of DATE. Here's the catch, not all of the months will have data. So here's where my problem is, I'm not able to use an IF ELSE statement along with a XDOXSLT:GET_VARIABLE expression so that if there's no data for that month the default value will be 0.
    Can someone help me find a solution to either one of the attempts below or a completely new method? Thanks!
    BP4 = numeric month value using DATE (more code to pull only month from DATE not included here)
    JAN1 = PRICE if data exists, else 0
    1) I tried this and it didn't work:
    <?if: xdoxslt:get_variable($_XDOCTX,'BP4'),01 then xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE) else xdoxslt:set_variable($_XDOCTX, 'JAN1',0) end if?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    2) I tried this and it didn't work:
    <?xdoxslt:ifelse(xdoxslt:get_variable($_XDOCTX,'BP4')='01',xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE),xdoxslt:set_variable($_XDOCTX, 'JAN1',0))?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    3) I tried this and it didn't work:
    <?xdofx:if xdoxslt:get_variable($_XDOCTX,'BP4')='01' then xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE) else xdoxslt:set_variable($_XDOCTX, 'JAN1',0) end if?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    sample XML:
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-01-01T00:00:00.000+08:00</DATE>
    <PRICE>31</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    -DrT
    Edited by: 990965 on Feb 28, 2013 8:27 AM

    let me clarify my logic, the template 1) searches for the relevant PRODUCT (in the case below, it searches for BPD which is the column in the table) 2) searches for the relevant month in DATE (which is the row in the table) 3) if data exists, get PRICE else default to 0
    Variable definitions:
    BP4 = numeric month value from DATE (more code to get this value not included here, but it works...)
    JAN1 = set to PRICE if data exists for that month, else 0
    the query is only pulling all of the existing data, so if there's no data for March then there wouldn't be a March entry in the xml. In the sample xml below, we only have data for the first two months (Jan, Feb) so that's the only data in the xml. I can't check if PRICE is null because the xml will not have any data for March.
    I've read through other threads and it seems that BI Publisher can't use an IF THEN ELSE with the XDOXSLT:GET_VARIABLE. I sent the template and xml to you.
    Sample XML:
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-01-01T00:00:00.000+08:00</DATE>
    <PRICE>31</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-02-01T00:00:00.000+08:00</DATE>
    <PRICE>30</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    Edited by: 990965 on Feb 28, 2013 8:30 AM

  • Help using multiple if else statements & manual dynamic xml data input to trigger a goto and play.

    Below is code that has a timer countdown that reads off of the computer. Below in bold is code to read "if it reaches the date, go to and play frame (2).
    timer.removeEventListener(TimerEvent.TIMER, updateTime);
      timer.stop();
      gotoAndPlay(2);
    Below is code that is manual input-   I had set up a dynamic txt field in flash named it : raffle_tix_remain When loaded on to the host I can manulally update the xml code and the change will take effect.
    raffle_tix_remain.text = root.loaderInfo.parameters.raffle_tix_remain;
    My question:  Since the raffle_tix_remain is a manual input from a user to xml  Is there a way to tell flash once it refreshes and "raffle_ tix_ remain"  goes to (0) zero gotoAndPlay(2); and let it play like a "sold out" sign
    i guess that would be a  if else statement. 
    Code Below-----------------
    stop();
    var year:Number = 2011;
    var month:Number = 12;
    var day:Number = 30;
    var finalDate:Date = new Date(year,month-1,day);
    var timer:Timer = new Timer(100);
    timer.addEventListener(TimerEvent.TIMER, updateTime);
    timer.start();
    function updateTime(e:TimerEvent):void{
              var now:Date = new Date();
              var remainTime:Number = finalDate.getTime() - now.getTime();
              if (remainTime >0) {
                        var secs:Number = Math.floor(remainTime/1000);
                        var mins:Number = Math.floor(secs/60);
                        var hours:Number = Math.floor(mins/60);
                        var days:Number = Math.floor(hours/24);
                        var secsText:String = (secs%60).toString();
                        var minsText:String = (mins%60).toString();
                        var hoursText:String = (hours%24).toString();
                        var daysText:String = days.toString();
                        if (secsText.length < 2) {secsText = "0" + secsText;}
                        if (minsText.length < 2) {minsText = "0" + minsText;}
                        if (hoursText.length < 2) {hoursText = "0" + hoursText;}
                        if (daysText.length < 2) {daysText = "0" + daysText;}
                        day_txt.text = daysText;
                        hour_txt.text = hoursText;
                        min_txt.text = minsText;
                        sec_txt.text = secsText;
              else {
                        timer.removeEventListener(TimerEvent.TIMER, updateTime);
                        timer.stop();
                        gotoAndPlay(2);

    stop();
    var year:Number = 2011;
    var month:Number = 12;
    var day:Number = 30;
    var finalDate:Date = new Date(year,month-1,day);
      var now:Date = new Date();
    var timer:Timer = new Timer(1000);
    timer.addEventListener(TimerEvent.TIMER, updateTime);
    timer.start();
    function updateTime(e:TimerEvent):void{
             var remainTime:Number = finalDate.getTime() - now.getTime()-e.currentCount;
              if (remainTime >0 || raffle_tix_remain==0) {
                        var secs:Number = Math.floor(remainTime/1000);
                        var mins:Number = Math.floor(secs/60);
                        var hours:Number = Math.floor(mins/60);
                        var days:Number = Math.floor(hours/24);
                        var secsText:String = (secs%60).toString();
                        var minsText:String = (mins%60).toString();
                        var hoursText:String = (hours%24).toString();
                        var daysText:String = days.toString();
                        if (secsText.length < 2) {secsText = "0" + secsText;}
                        if (minsText.length < 2) {minsText = "0" + minsText;}
                        if (hoursText.length < 2) {hoursText = "0" + hoursText;}
                        if (daysText.length < 2) {daysText = "0" + daysText;}
                        day_txt.text = daysText;
                        hour_txt.text = hoursText;
                        min_txt.text = minsText;
                        sec_txt.text = secsText;
              else {
                        timer.removeEventListener(TimerEvent.TIMER, updateTime);
                        timer.stop();
                        gotoAndPlay(2);

  • Use If then else statement to display concatenated values

    Hi,
    I am trying to create a field which will display 2 different names depending on the status of another field.
    Here is the code I have but it returns no data when I try it:
    <?xdofx:if ReportStatus='Approved' then concatenate(DisplayFirstName, DisplayLastName) else concatenate(InvFirstName, InvLastName) end if?>
    (Also I need to solve how to create a space between the first and last names)
    Any help would be appreciated thanks

    Use the following.
    <?choose:?>
    <?when:ReportStatus='Approved' ?>
    <?DisplayFirstName?> aspace <?DisplayLastName?> or <?concat(DisplayFirstName,' ', DisplayLastName)?>
    <?end when?>
    <?otherwise:?>
    <? InvFirstName?> a space <? InvLastName?>  or <?concat(InvFirstName,' ', InvLastName)?>
    <?end otherwise?>
    <?end choose?>

  • How to use IF ELSE statement in one QUERY to MS ACCESS

    System.out.println("Enter Final Exam: ");
    int f = Integer.parseInt(input.readLine());
    command.executeUpdate("UPDATE Students SET Final_Exam='"+f+"',Raw_score=(QT+MT+Final_Exam)/3 WHERE stud_name='"+stdID+"'");
    command.executeUpdate("UPDATE Students SET Raw_score=(QT+MT+Final_Exam)/3 WHERE stud_ID='"+stdID+"'");
    if (rsf==100)
    command.executeUpdate("UPDATE Students SET Final_Grade=1.0 WHERE stud_ID='"+stdID+"'");
    else if(rsf < 100 && rsf > 90)
    command.executeUpdate("UPDATE Students SET Final_Grade=2.0 WHERE stud_ID='"+stdID+"'");
    else
    command.executeUpdate("UPDATE Students SET Final_Grade=5.0 WHERE stud_ID='"+stdID+"'");How can I shorten my code using a IF ELSE statement inside a single query or two? Or is it possible?
    Edited by: ivatanako on Sep 28, 2007 11:55 PM

    Sun has tutorial trail for JDBC, you might want to browse through that; you'll get more details and samples there than here. Here's the link to the section on PreparedStatement: http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • If Else Statement in Validation of Other Field's Values

    Thanks in advance for your help.
    Here is the statement:
    $3,000 (maximum contribution)
    OR my remaining balance $ (remaining balance field)
    $ (total field)
    The maximum that the user can contribute is $3,000. If they enter a number greater than $3,000 for the remaining balance, The total for that statement should be $3,000. If they enter a number less than $3,000 for the remaining balance, the total for that statement should be the number entered for the remaining balance.
    I think I'm actually making this more difficult than it needs to be. I would like the total field to evaluate the user's entry into the remaining balance field; if that number is greater than.3,000, the total is 3,000; if not, the total field is equal to the value entered into the remaining balance field.
    Thanks again for your help.

    Gilad D (try67) wrote:
    There are two problems with your code:
    1. In a Calculation script one should apply the new value using event.value, not by using the getField method.
    2. You should convert the value of "Remaining Balance" to a number explictly.
    So the code should be:
    var b = Number(this.getField("Remaining Balance").value);
    if (b > 3000){
        event.value = 3000;
    } else event.value = b;
    I see, thanks Gilad.

  • Inserting a 'null' value in an IF THEN ELSE statement

    Greetings,
    I'm using Business Object webi XiR3
    I'd like to return a 'null' value in certain cases for an IF THEN ELSE statement.  Depending on if I format the field as a text or a number, I can return blanks ("") and zeros (0).  However, what I really need to do is leave the field / column formatted as a number and return a 'null' value.  You can see the variable below ... this will return a blank but the column is text.
    Suggestions?
    thanks.
    variable:
    =If([Comp Rate Mid] = 0 And( ([Market Rate 50th].085) - [Annual Total Targeted Comp] >=0) ; ([Market Rate 50th]0.85) - [Annual Total Targeted Comp]; If([Comp Rate Mid] <> 0 And( ([Comp Rate Mid] 0.85) - [Annual Total Targeted Comp] >=0) ; ([Comp Rate Mid]0.85) - [Annual Total Targeted Comp];""))

    I don't think this is possible using a formula, as formulas deal with content, and images can be placed in cells only as 'image fill', which is Format, rather than Content.
    Might be possible using an AppleScript, but I'm not the person to advise you on that.
    Regards,
    Barry

  • How to Get ZERO and Non-ZERO Values in rowcount using Group by?

    Dear All,
    How can I get Non-ZERO and ZERO row count values in SQL using Group by? I can get non-zero values but when I want NULL should be returned to non-zero values it is ignoring ZERO values in output?
    Any hint?
    Thanks
    GQ

    Hi,
    Something like
    select count(case col
                    when 0
                    then 1
                  end) zero_count,
           count(case nvl(col,1)
                    when 0
                    then null
                    else 1
                  end) nonzero_countRegards
    Peter

  • Null values returned when using request.getParameters(

    I have a html form which allows the user to choose options and select a file to upload. When I use method=Post I get null values returned. When I use method=Get I get my parameter values fine.. but I get an error.
    "Posted content type isn't multipart/form-data"
    I would like to know why I am getting null values returned when using Post. I am using the following to get the values from the name=value passed to the servlet.
    String strIndustry = request.getParameter("frmIndustry");
              String strCompany = request.getParameter("frmCompany");
              String strCollabType = request.getParameter("frmCollaboration");
    I have another form where the user can search information in a database that works just fine w/ either Get or Post
    Or perhaps I am using oreilly MultipartRequest incorrectly??? but I copied it directly from another discussion.. ???
    any thoughts
    Thanks

    taybon:
    you could do it like this. in this case, you submit your form with the parameters (industry, company, collaboration), and upload your file at the same time. and in the target servlet, you can build your MultipartRequest object like this:
    MultipartRequest multi = new MultipartRequest(request, temp_location, 50 * 1024);where variable temp_location stands for a temporatory diretory for file uploading.
    and then you get your parameters, so you can build the directory with them. and after that, you can move your file to that directory using File.renameTo();
    but as i've suggested in my previous posting, i just recommend you upload your file in a separate form. and then you can perform an oridianry doPost form submit with those parameters. or you may have problems with the file uploading. (this is just my personal experiences with Multipart).
    there is one other thing i'd like to mention, file.renameTo() won't work if you need to move files to a network drive in windows. it won't work if you move files across file systems in unix.
    Song xiaofei
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

  • Where to look for all value mappings being used in ID

    Hi All,
              Where to look for all value mappings being used in ID?
    XIer

    Hi,
    Let me re-frame it, Do u want to know where all the value mappings(created in ID) is used in Mapping Program of IR, isn't it?
    If yes, then it's not possible( as far as  I know).
    raj.

  • How to use return value from TestComplete ( using COM) as a variable in the conditional statement (e.g. while loop) in TestStand

    Hi,
    I have setup a COM interface for TestStand(TS) to run certain scripts in TestComplete (TC).  Normally, when TestComplete finishes executing the script, it returns a 0 or 1 to denote pass/fail in the TestStand step (e.g String value test step).  This worked fine.
    However, now I need TestComplete to return a vaule( e.g 32) to TS, and TS need to evalue this value in a while statement. So if TC return value is 32, I'd have some statement in TS ike :                                                                                                 
    While (return value != 30)
    Do something..
    Thanks,
    Solved!
    Go to Solution.

    There are a hundred ways to implement what you are asking.  The hard part is deciding which one would be the best for you.
    What adapter are you using to communicate with TestComplete?  ActiveX?  Is TestComplete running asynchronously (in parallel)?  If so then how is the data getting back to TestStand?
    So here are some options:
    1. You can use the While Step type.  It's in the Flow Control folder in your Step Types pallette.  Look in your examples under UsingFlowControlSteps.seq in the SequenceFlow
    2. You can loop on a step and have the termination for the loop be (return value == 30).  Look in the Step Properties under Looping.  Also in the TestStand help
    3. You could do Post Actions based on a condition and have it jump to another step.  Read about it in the TestStand Reference Manual.
    4. You could use a GoTo step.  I don't really recommend this one.  It makes code hard to maintain.  Also an example in SequenceFlow called gotobeep.seq.
    Hopefully this gets you thinking.  Let me know if you have specific questions about any of these methods.
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How to Pass Click Value to DB using Java

    How to Pass Click Value to DB using Java and display tat
    clicked value row data in flex
    i have created connection with Sql Server using java and drew
    pie chart from values fetched from XML file created by Java
    wat i need is when i click pie chart region (widget) i should
    display a alert by giving value of particular widget name and Value
    from Database and display in Flex Alert

    Use AddResource to add Javascript in your BackingBean Code and pass the value to your javascript code.
    JSCookMenu and other dynamic adding of javascript to a JSF-JSP page is done using AddResource....

  • How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amo

    How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0

    Hi,
    Is your formula attached to basic salary element or some other element? You need to make sure that basic salary element has some value and is processed before this formula is called. Are you able to see value for basic salary element after payroll run?
    Regards,
    Pawan

  • HT201210 nowadays have many user have problem with update to ios7 and need active with apple id maybe in the future in order escape from these problems must be stop use these products else. Because of simple user don't know about this technology and somet

    nowadays have many user have problem with update to ios7 and need active with apple id maybe in the future in order escape from these problems must be stop use these products else. Because of simple user don't know about this technology and sometime just hear from other user that it 's difficult to use then force they change phone that use to handle to another.

    It is a feature to discourage the theft of iPhones by making them useless if resold. It's not going anywhere. It's simple: just don't buy a phone until you make sure that the activation lock has been disabled.

  • Airtunes speakers "being used by someone else"

    Hello. I have an Airport Extreme running a WDS, and an Airport Express as a remote basestation on that network. Everything works fine, except that, as of last week, choosing the Express' remote speakers in iTunes results in the message that they are "being used by someone else."
    I have tried everything I have read in the forum, to no avail. My firmware is up to date. I have the latest iTunes (6.0.1). I'm running 10.4.2. I have set the Express back to factory default, and set it up again fresh. I have renamed the Airtunes speakers. Nothing does any good.
    The story is this: a couple of weeks ago, our receiver blew out, and we took our system apart for repair. At that time, Airtunes was working perfectly. We got the receiver back, fixed, and reinstalled everything this past weekend. Airtunes gives me this error now. We have a TiVo Series 2 box plugged in to the Ethernet port of the Express, and it is networking fine. I have not installed the TiVo Desktop software, so my Mac running iTunes should not be confused about where it is sending audio.
    My only thought is this: Airtunes settings include the checkbox to enable Airtunes over Ethernet. This choice, while enabled, is also grayed out, so I can't turn it off (I'm told this is part of the WDS or something?) Could the Express be confused, with something plugged into the Ethernet port, thinking that this is using the speaker setup?
    I tried running iTunes with the TiVo unhooked from the Ethernet port, in fact, I tried it right after factory resetting the Express (I never plugged the Ethernet jack in) but it still gave me the "being used by someone else" error.
    Can anyone help?
    Thank you,
    Danny.

    Henry,
    Well, I am glad to hear that it isn't the settings, nor the TiVo plugged in. But that does leave me in a state of limbo, eh? To reiterate, I have restarted the iTunes running Mac (we also have an iBook, but it has been shut down for all these tests), and I did factory reset the Express.
    Would it help to factory reset the Extreme? I wouldn't think so, it having nothing to do with Airtunes... but I'll try anything.
    I've seen in other threads that iTunes 5 appeared to produce this effect for some people... (though the majority of them were streaming fine and then would suddenly lose their speakers, whereas mine never make an initial connection...) could it be that iTunes 6 and 6.0.1 are doing it to me? There was no posted resolution for those other people, so I don't know if they had their issue solved.
    Still tuneless,
    Danny.

Maybe you are looking for

  • Retrieve Novell Username when not logged into Portal

    Hi, Is there a way I can store the users Novell username into a variable? This would be done in a report, displayed on the Portal homepage. I require this functionality before the user logs into the portal, so I can't use PORTAL.wwctx_api.get_user. T

  • Send cpQuizInfoTotalCorrectAnswers to javascript

    Hello Captivate users I haven't found anything useful about this: I got a problem with a javascript function within captivate. My aim is the following: If the user enters the last slide of a quiz, a javascript function (On enter Slide: Execute Javasc

  • IDOC Error Status 64

    Hi All,                 While posting IDOC , I am getting Status 64.Please let me know how to proceed further. Regards Raghav

  • Question Mark on Chess

    My son loves to play chess on my new imac. This morning when I sat down to work on the computer I saw a question mark over the chess icon. I can't open it or even find anything about chess on the computer. That being said, this machine is new to me a

  • The web controls not work(windows phone)

    Hi I have a web app.after I make an animation in this page(like a transition page in loading page), the web controls not work more. the site is shown but any thing not work like scrolling or tap in links