Can't subtotal on measure variables from Query 2 in merge dimension report

I use a query identifying customers (Query1.HH_ID) sold by each salesperson. A second query identifies a subset of those customers who are longtime customers. I merge these queries using the dimension, HH_ID. I project Query1.HH_ID onto the report and create a variable via =If([Query2].[HH_count]=1;1;0) to get a measure which is either 1 or 0 depending on whether a record is retrieved from Query2 with a value for Query2.HH_ID that matches Query1.HH_ID. The report is fine at the detail level, but when I insert a break and try to subtotal the measures, the variable from Query 2 produces a subtotal of 0 even though I can see a mixture of detail records with 1s and 0s. It appears that one cannot subtotal on measures from Query2 in a merged dimension report, or at least not if the merged dimension is not projected onto the report but rather only the dimension from Query1. Is this a known principle?

Hi Michael,
I think the issue is that they Query2.HH_Count is being summed first. So if you have a mixture of values, say
rownumber, value
1,1
2,0
3,1,
4,0
you will get 0 as your HH_count will equal 2.
Try
=If(Query2.HH_count>=1;1;0)
Alternatively try
=If(Average(Query2.HH_count)=1;1;0)
Hope this helps
Alan

Similar Messages

  • How can you create a local variable from a boolean control?

    I want to create a local variable from a boolean control, but it says that boolean latch actions are incompatible with local variables, but I need a way to check this boolean control in two differents loops, how can I do it?

    "Graci" schrieb im Newsbeitrag
    news:[email protected]..
    > I want to create a local variable from a boolean control, but it says
    > that boolean latch actions are incompatible with local variables, but
    > I need a way to check this boolean control in two differents loops,
    > how can I do it?
    Use global variables.
    Compare them with a constant Boolean like F or T.
    The result is true or false and then you can use it in a Cae-Loop.
    Martin

  • Delete variable from Query

    Hi Guru's,
       I copied a query saved with a new name and made some changes to the new one, when I run the Query I get 3 variables(pop up) eg., PlanVersion, Period Interval, Year. I dont need Plan Version, Period Interval, but need just the Year...When I see the Query Properties I see all the three Variables I dont have the option to delete any of them... Any ideas would be highly appreciated...
    Cheers..
    PR

    Hi PR,
    You cannot delete the variables from the query properties. You will need to delete them from the query definition (rows, columns, filter and free char areas). The period variable would be restricting char 0FISCPER (most probably) so see where it is included in the query definition and remove it from there. Same goes for the Plan Version.
    Hope this helps...

  • How can you get  the public variables from object that extends JLabel?

    I'm using the mouseClickedListener method e.getComponent(); to get the component that is clicked on the sceen. The component i clicked is type "object" and extends a jlabel, and i really need to acces a variable from it. Heres the code i'm using-
    MouseListener listenerDown=new java.awt.event.MouseListener() {
            public void mousePressed(MouseEvent e){
                paintAll();
                mX=e.getX();
                mY=e.getY();
            public void mouseClicked(MouseEvent e) {
                Component c = e.getComponent();
                drawResizeBox(c);
                selected=c;
            public void mouseReleased(MouseEvent e) {
            public void mouseEntered(MouseEvent e) {
            public void mouseExited(MouseEvent e) {
    package javapoint;
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Rectangle;
    import java.awt.RenderingHints;
    import java.awt.geom.Line2D;
    import java.awt.image.BufferedImage;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JLabel;
    public class object extends JLabel{
        public object(Rectangle rect,int id){
            idNum=id;
            Rect=rect;
            BufferedImage image = new BufferedImage((int)rect.getWidth()+1, (int)rect.getHeight()+1, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g = (Graphics2D) image.getGraphics();       
            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g.drawRect((int)rect.getX(), (int)rect.getY(), (int)rect.getWidth(), (int)rect.getHeight());
            Icon icon = new ImageIcon((Image)image);
            setIcon(icon);
            setBounds((int)rect.getX()-1, (int)rect.getY()-1, (int)rect.getWidth()+1, (int)rect.getHeight()+1);
            mainFrame.slideArr[mainFrame.sIndx].add(this);
            setVisible(true);
            r=true;       
        object(Oval oval,int id){
            idNum=id;       
            setBounds(oval.getX(), oval.getY(), oval.getWidth(), oval.getHeight());
            getGraphics().drawOval(oval.getX(), oval.getY(), oval.getWidth(), oval.getHeight());
            o=true;
            setVisible(true);
        object(Line2D line,int id){
            idNum=id;       
            setBounds((int)line.getX1(), (int)line.getY1(), (int)line.getX2(), (int)line.getY2()); //Not gunna work
            getGraphics().drawLine((int)line.getX1(), (int)line.getY1(), (int)line.getX2(), (int)line.getY2());
            l=true;
            setVisible(true);
        object(Icon icon,int id){
            idNum=id;
            setIcon(icon);
            setBounds(50,50,icon.getIconWidth(),icon.getIconHeight());
            i=true;
            setVisible(true);
        void drawObject(object obj){
            if(r){
                Rectangle rect=obj.Rect;
                setBounds((int)rect.getX()-1, (int)rect.getY()-1, (int)rect.getWidth()+1, (int)rect.getHeight()+1);          
                Rect=rect;
                BufferedImage image = new BufferedImage((int)rect.getWidth()+1, (int)rect.getHeight()+1, BufferedImage.TYPE_INT_ARGB);
                Graphics2D g = (Graphics2D) image.getGraphics();           
                g.setColor(Color.red);
                g.drawRect(0, 0, (int)rect.getWidth(), (int)rect.getHeight());           
                Icon icon = new ImageIcon((Image)image);
                setIcon(icon);
            }else if(l){
            }else if(o){
            }else if(i){
        public boolean r=false;
        public Rectangle Rect;
        public boolean o=false;
        public Oval Oval;
        public boolean l=false;
        public Line2D Line;
        public boolean i=false;
        public Icon Icon;
        public JLabel label;
        public int idNum;
    }Edited by: ghostbust555 on Feb 12, 2010 2:14 PM

    ghostbust555 wrote:
    Well see the problem is i have an array of 200 objects.What does that have to do with anything? And if it does, why isn't it in the code you posted?
    I dont understand what you mean in your "Edit..." part. could you show some code/ explain farther? sorry if its a dumb question I'm still a bit of a novice at java.Yeah.
    object yuck = (object) e.getComponent(); // That's a cast.
    boolean yucksR = yuck.r; // Get the "r" variable from the object.

  • Can't load Print Layout Designer from Query Manager

    Hi All,
    I'm facing this issue when I try to load the Print Layout Designer from Query Manager.
    I define my own query report and I need to change the layout for the report.
    When I click on the print layout designer button is nothing happen.  I've check the the RDOC table the report already created in the RDOC.
    How do I call out the layout to customize it?
    Please advice.
    Thank you.
    Regards,
    Foong Yee

    Hi
    If i remember correctly you must use the menu at the top. Click tools->queries->query layout designer.
    Hope this helps

  • How can I use Server level variables in a business model based report

    hi gems..
    I have declared one server level variable in the BI Analytics repository.
    Now I have made one business model based report.
    In one column I want to use that server level varible.
    I go to the formula tab of that column and then clicked on variable--> session --> put the name of the variable and click ok.
    But when i viewed the report, it is not showing the dates, rather it is showing the date format I chosed i.e DD-MMM-YYYY.
    please help..

    actually the previous problem got resolved...
    Now when I am trying to apply a filter on a particular column using that server variable, then it is showing that the varible has no value definition.
    I have clicked on the filter tab of that column-->add-->variables-->session variables-->then I put the name of the variable-->click OK.
    the following error is comming-
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 23005] The repository variable, Variable_name, has no value definition. (HY000)
    I have made that server variable from manage-->variables-->(right click) create new initialisation block-->gave the name and wrote the query and aslo gave the connection pool name and test that and it worked fine..

  • Alternative for result from other query  and merge dimension option option

    Hi Everyone ,
    Am Developing one webi report over bex Query.
    Actual scenario is output of one webi report should be the input of other webi report.
    Eg:
    Table 1
    2010        Cus 1
    2010        Cus 2
    2011        Cus 3
    table 2
    cus1    m1   100
    cus2    m2   200
    Cus3    m1  400
    Report 1 designing 
    First report created using table 1 and prompt for year
    Report  2 designing
    Second report created using table2 and prompt for customer
    So when am Running first report it will ask for parameter year and if am selecting 2010 then the report will return C1 and C2
    this out put should e the input for report 2.
    So out put will be 100+200=300
    NOTE:1. Result from other query is not working in webi filter pane since am building on olap universe.
               2. Merge Dimension performance is very slow .
    Any Solution ?
    Regards,
    Kannan.B

    Hi,
    Thanks for ur reply
    As you said , If am giving hyperlink to other report .
    Eg: User selected Tamilnadu then report 1 opened  then  he has to click the some cell or hyperlink cell to view the actual report(2nd report).
    Suppose user Clicked that hyperlink cell and 2nd report opened and he is viewing the data for Tamil nadu and he decided to see the report for
    Andrapradesh so according to this logic he has to select first report and refresh the data for Andra and from there he has to come to 2nd report.
    totally 4 screen will be opened for seeing the two states report.
    So Some other alternative.......

  • Can Indesign CC generate QR codes from a data merge?

    Looking to generate QR codes from a data merge.  Currently I have to manually generate the codes with a batch generator and then save them out as links and import them with the data merge.
    If Indesign CC could generate them all in one swoop that would remove a lot of external steps in the process.
    Is there any way to do this?

    Not directly from the data merge panel or flyout. This would be something that may be able to be scripted, but I haven't seen a script that will do this... yet.
    There are PAID third party plugins like Meadows Publishing Solutions that will do this. http://www.meadowsps.com/free2d is a taster of what it can do. XMPie is another one, or teacup software has one as well.

  • Can I set a Session Variable from a Dashboard Prompt, using values that are

    Hi All
    Trying to set a Session Variable to an integer value, by letting users select a text value from the drop-down list on a Dashboard Prompt. The goal is to set the input parameter to the IndexCol function, but to provide the end users with a text description of what they are setting.
    Select Value Set Variable Value
    My 0
    My Team 1
    My Companies 2
    My Teams Companies 3
    Any suggestions on how to accomplish this? Certainly we could populate the drop-down from a data source, however I don't see how to populate a variable with something other than the values on the screen.
    The IndexCol function is referenced in a Filter in Answers, and I'm thinking to populate a Session variable using the (Presentation) variable value set from the prompt. But how to do this? I see a reference to a function NQSSetSessionValue(), but cannot find documentation on how it works.
    Any clue will be greatly appreciated.
    Thanks

    Hi kishore..
    Looks like the link u have sent uses advanced SQL tab to set session variables. I want to know if I can use "set variable NQ_SESSION.myvar= @something" in the "SQL results" -while creating a dashboard prompt-.
    Purpose: I want the session variable to be set based on whatever report that im currently in.
    And i dont want to use presentation variables because im using a reset button in my page.
    My reset script resets presentation variables and NOT session variables.
    Thanks in advance
    Loy

  • How to get value in variable from query in PLD / ALD

    Hi, everyone,
    I want to retrieve value from database via query in PLD/ALD variable on basic of PLD / ALD variable's content. is it possible ?

    Hi
    Try this,
    ->> Open the GRPO document.
    ->> Click the Tools on menu bar and Open the Form Setting widnow.
    ->> put the tick mark in BaseRef, BaseDoc, TrgetDoc
    i think, Base Document no field default in SAP B1.
    try to search the Base doc. Date in row level on GRPO document.
    Try to Create UDF & FMS then assign the FMS in UDF
    SELECT Distinct T1.DocDate
    FROM PDN1 T0 INNER JOIN POR1 T1
             ON T0.BaseEntry=T1.DocEntry
    WHERE
    T1.[DocNum]=$[PDN1.BaseRef]
    OR
    SELECT Distinct T1.DocDate
    FROM PDN1 T0 INNER JOIN POR1 T1
             ON T0.BaseEntry=T1.DocEntry and
                T0.BaseLine=T1.LineNum and T0.BaseType=22
    WHERE T0.[BaseType] =22
       and T1.[DocNum]=$[PDN1.BaseRef]
    IF you more details, Check the below thread.
    Re: How to store the invoice number in the head of the related delivery ?
    Regards,
    Madhan.
    Edited by: Madhan Babu C on Dec 11, 2009 6:57 AM

  • Can not create a environment variable from a script

    Hi I need to develop a script that allows me to create and set two environment variables in my system but I can�t get it ....
    This is what I got till now ...
    #!/sbin/sh
    SEISDB_HOME=/usr/local/
    export SEISDB_HOME
    LD_LIBRARY_PATH=/usr/local/lib
    export LD_LIBRARY_PATH
    If I run this commands directly in the shell it works Ok ... but calling the sentence from a script nothing happens ....
    Thanks ....
    Edited by: Jes_79 on Sep 18, 2007 1:58 PM

    do this
    create a script file
    vi /tmp/temp
    in /tmp/temp add
    GLOBAL_VARIABLE="Hello World"; export GLOBAL_VARIABLE
    save and quit vi
    fix the permissions and run /tmp/temp from a shell prompt
    then
    echo $GLOBAL_VARIABLE
    should show as empty
    from a shell window type
    . /tmp/temp
    period space /tmp/temp
    echo $GLOBAL_VARIABLE
    for you script, do the same.
    do not type the script name, but source it (add a period and space)
    alan

  • How can I change my Shared Variable from "I/O Variable" to "Network Published"

    Hello,
    I have an application that is using a series of NI wireless sensor nodes.  I am trying to programmatically access shared variables.  Right now the only method I have found to access the data from the shared variables is datasocket read.  I am on labview 8.6.1 so I don't have as many shared variable options as newer versions of labview.  I do think there is a way to access properties for the shared variables, but I'm not sure about how to change the nodes channel properties to "Network-Published".  Do i need to remove the node from the project and bring it back in with the new settings?  When i have done this in the past i have run into naming conflicts.  I would appreciate any ligtht that can be shed on this issue that will help me create a vi that operates quicker.

    Any Shared Variable that has “I/O Variable” for its Variable Type (see screenshot of the Shared Variable Properties below) refers to any channel of data (such as Analog Input or Output or Digital Input or Output) directly from a module channel.  In other words, this is how you directly get the raw reading straight from (or to!) a specific module channel.
    You cannot edit the Variable Type to Network Published.  You can check “Enable Network Publishing” as above, which allows this Variable to be accessed from a VI on a Host VI.  You could also create a separate Network-Published Shared Variable which you can wire directly to the I/O Variable on the Target VI if you wish.
    Best,
    Ryan C.
    Applications Engineer
    National Instruments

  • Create variable from query filter

    Hello;
    I want to define  @prompt parameters as dimension or measure. So that we will use those parameters for the calculations we will use in our reports.
    For example; we will like to use prompt for year in efasion universe. This prompt is going to ask two year parameter (the operant we will use is between) We want to get the difference between these two years . and we will like to save that value as a  different variable.
    System: BusinessObjects XI 3.1
    Thanks in advance.
    Akar;
    Edited by: Akar Selcik on Apr 22, 2011 12:07 PM

    hi Dineshkumar89 ;
    I checked the your formula . But variable when used alone returns correct results But it returns wrong value or error  in same record.
    for instance;
    i created a variable named diff.year.  formula = Abs(ToNumber(First([Year]))-ToNumber(Last([Year])))
    selection value :  First : 2001  Last:  2003 
    year     Sales Revenue Diff.year
    2001     39600         0
    2001     3500         0
    2003     6500         0
    Results should be as below.
    year     Sales Revenue  Diff.year
    2001     39600          2
    2001     3500          2
    2003     6500           2
    thanks.
    Akar;

  • Can i reference an environmant variable from a package?

    Hi,
    My problem is this,
    I am using a file from a package to dump some of my data. The
    path or the file name need not be fixed. I would like to pick it
    up from the environment. Is this possible ?
    In short is there a function in Oracle similar to getenv() in
    Unix?
    Thanks in advance.
    null

    vishakha (guest) wrote:
    : Hi,
    : My problem is this,
    : I am using a file from a package to dump some of my data. The
    : path or the file name need not be fixed. I would like to pick
    it
    : up from the environment. Is this possible ?
    : In short is there a function in Oracle similar to getenv() in
    : Unix?
    : Thanks in advance.
    Did you try "OWA_UTIL.GET_CGI_ENV('VARNNAME')"
    This is not for Ora-Lite. It is a PLSQL package belonging
    OAS's and WebDB.
    Txr
    null

  • How we can pass the list of variable from ref cursor ??

    pls explain with example

    Simple example:
    SQL> create table t as select level col from dual connect by level <= 10;
    Table created.
    SQL> create or replace procedure myproc
      2    ( p_num_list in sys.odcinumberlist
      3    , p_ref out sys_refcursor
      4    )
      5  as
      6  begin
      7    open p_ref for select col
      8                   from   t
      9                   where  col in (select * from table(p_num_list));
    10  end;
    11  /
    Procedure created.
    SQL> var rc refcursor
    SQL> set autoprint on
    SQL> exec myproc(sys.odcinumberlist(1,2,3), :rc);
    PL/SQL procedure successfully completed.
           COL
             1
             2
             3
    3 rows selected.
    SQL> exec myproc(sys.odcinumberlist(1), :rc);
    PL/SQL procedure successfully completed.
           COL
             1
    1 row selected.
    Search http://asktom.oracle.com for more examples...
    Also, see:
    The Tom Kyte Blog: Varying in lists...

Maybe you are looking for

  • Problems after update with itunes on windows vista

    I tryed to do the latest update on my itunes that is linked to my ipad mini.Now I'm getting Microsoft Visual C++ runtime library,R6034.Windows error 7 error 127.I tryed to repair itunes no luck,so I reinstalled itunes no luck.I tryed the apple update

  • I subscribe to the latest Acrobat. Crashes every time I open it.

    Adobe is about to lose me. PDF's are mission critical for my business. Why can't you make something that works? I need an answer NOW!!! I am done with Adobe if this is not fixed today.

  • Horizontal scroll in pdf

    I am trying to create a pdf which will contain 35 cloumns. But after some column, other columns are discarded from pdf. What steps will I follow for making a pdf with 35 cloumns? Please help or please direct me. Thanks, Ripa Saha

  • Phantom Lines in CP (6.1.0.319) Software Simulations

    Does anyone else have a problem with phantom lines showing up in their published CP software simulation slides? They don't display in my previewed copy, but do in the published SWF... and only in my software simulations, not in non-recorded slides. T

  • Editing Word docs

    What is the preferred app for editing Microsoft Word docs ie .docx, please? Many thanks