Crosstab with a twist

Hi,
Say I have a crosstab with 3 Columns, Jan08, Feb 08, and Mar08 and two rows for Employee X.  One row displays Sum of Sales while the other displays Sum of Commissions.
Here's what I want to do:
If the Sum of Sales is below zero then make Sum of Commissons field RED otherwise DefaultAttribute OR
if the previous month's Sum of Sales was below zero, make this month's Sum of Commissions field RED as well.  So take this scenario for example
                               Jan08       Feb08     Mar08
Employee X   
Sum of Sales            -20            10            30
Sum of Commisson       15             35            40
I want the values 15 and 35 to be RED in this example.
Yesterday, I learned how to figure out the first part of my logic:  (if the Sum of Sales is below zero then make Sum of Commissions field RED otherwise DefaultAttribute)  Here's the logic for that
In Sum of Sales Suppress X+2 Conditional Formula add this:
whileprintingrecords;
numbervar i;
i:=currentfieldvalue;
false
Now you have the sum of sales in the variable i; so right click on the sum of commision field and go to font color and write this
whileprintingrecords;
numbervar i;
if i<0 then
crred
else
defaultattribute
So, how can I accomodate the second part of the OR clause?, namely:
OR
if the previous month's Sum of Sales was below zero, make this month's Sum of Commissions field RED as well.
Thank you in advance,
Zack H.
Edited by: Zack H on Sep 9, 2009 10:39 AM

Raghavendra,
I'm almost there I can taste it.
So here's what I've done so far.
I created a formula called {@Setting x} and placed it in the Report Header.
Whileprintingrecords;
global numbervar x;
x:=1;
I created a formula  called {@Store Array Values} and placed it in details section (its a summarized table so detail section is fine, stores right results);
whileprintingrecords;
global numbervar array arr;
global numbervar x;
redim preserve arr[1000];
arr[x]:={Table.Value};
x:=x+1;
In the Crosstab's format field -> Font tab -> the conditional formula now looks like this.
whileprintingrecords;
global numbervar i;
global numbervar array arr;
if i<0 or arr[6]<0 then
crRed else
DefaultAttribute
I just inserted 6 as that is the row that has a negative Sum of Sales.  This actually turned all the Sum of Commissions row RED.  Obviously I am missing the step where I need to have the array dynamically change as each crosstab column changes so I don't have to hard-code the 6 (as shown in this example).  Any ideas?
Thanks again,
Zack H.

Similar Messages

  • Crosstab or Crosstabs with different date ranges not lining up.

    I have a crosstab with a dimension (item) in the vertical axis, and different date ranges on the Horizontal (top) axis.
    I want to display counts of a measure over specific ranges of time. For instance, count of items sold for weeks 1,2,3,4, horizontally, then count of items sold for months 1,2,3,4 horizontally, next to each other.
    Problem is that count rows by item do not line up. Count by week has fewer items, so it has fewer rows than the counts by month. I need it to have the same number of rows, and just show 0 or blank in that row, instead of just not being there. I need all rows to line up by item.
    Its like there needs to be an outer join, but I haven't been able to make it work. What am I missing?
    Does that make sense?
    Any ideas welcome. Thank you!

    Wavery,
    You are looking to display a grid with a high degree of consistency, regardless of the data present.  There is no "single" step capability provided by WebI to achieve this, so it requires creativity on your part.  A second data provider (DP) for your report is necessary and can be either a view in your database, a custom SQL, or some folks have even built a derived table in their universe to accommodate.  At any rate, there are one of two ways to achieve.  If you are familar with SQL and the "union" statement, you would run the basic SQL, then via union, dummy up a second query that has all the requisite columns, but for the measures you would use a value of zero so as not to affect the generated facts.  For example, suppose you had a report for a hardware store, and you wanted to track the following items:  Nails, Flashlights, and Screws.  Your basic query might look like this:
    select item,sum(inventory) from inventory_table where item in ('nail','flashlight','screw') group by item
    Then your next portion of code:
    union select 'Nail',0 union select 'Flashlight',0 union select 'Screw',0
    See how the union is providing "dummy" info?  To do this in WebI with a second DP, you would not use union, but a separate view perhaps, then in WebI apply Merge Dimensions on the item column (and the equivalent of an outer join).
    Thanks,
    John

  • Photos missing from iPhoto/TM backup but with a twist.....

    So, there is a challenging twist associated with this case of missing photos and I hope an expert can provide some advice. Note: This is not related to upgrading from iPhoto '09 to '11 thank goodness!
    Here is the story in condensed form, with additional details below:
    MBP stolen but backed up with TM
    Used TM on the replacement MBP to browse backup of iPhoto backup of stolen MBP
    Restored iPhoto library to new MBP
    Open iPhoto on new MBP and browse library
    Everything looks OK except *FIVE* Events which show in the Event viewer as blank grey squares. However, the Events have the correct titles and show the correct number of pictures in brackets in the title. In addition, using the trackpad to scroll over the Event there are no thumbnails visible. If I click on the Event all the photos are greyed out but they do have the correct titles and keywords below the grey boxes. If I click on an individual photo I get a black exclamation mark in a grey circle. Interestingly the LAST IMPORT folder in iPhoto DOES show the thumbnails for ALL the missing pictures, all arrange with the correct Event titles. Of course, clicking on any individual picture gives me the same exclamation mark detailed above.
    After reading these support forums I have tried the following:
    1) Viewed package contents ---> the blank Events DO NOT show up as folders in the Finder window
    2) Used COMMAND & OPTION to launch iPhoto and checked the following boxes in the REBUILD DIALOG BOX: rebuild small thumbnails/rebuild all of the photos' thumbnails/recover orphaned photos/examine and repair permissions ---> Issue persists
    3) Download iPhoto Manager and tried EXTRACTING all the photos from the library --> Photos from missing events still not showing up. Not really surprising given that the VIEW PKG. CONTENTS in #1 above didn't show them either.
    4) Used iPhoto Manager to REBUILD LIBRARY --> still doesn't show them
    5) Used TM to browse the backup directly --> missing photos have blank placeholders only.
    It appears for what ever reason the photos have been deleted from the backup. I say "deleted", as opposed to "not backup up", because iPhoto has the remnants of the photos (i.e, Events, thumbnails, titles, keyword, etc.). Any suggestions on how to possibly recover these missing pictures. How about the thumbnail versions at least, even in their their low resolution form. Although, I admit I don't know how/where thumbnails are dealt with in iPhoto as they don't seem to show up in the Library package contents.
    Additional info:
    OSX 10.7.5, iPhoto '09 is version 8.1.2, and iPhoto library is 75GB, 139 Events, 28,000 pics
    The day before the MBP was stolen I downloaded a number of photos and did some editing. That night plugged the MBP in and noticed that the Time Machine did a number of backups through the night, although the iPhoto library seems untouched but can't be sure. The following morning, the computer was used for a few hours and thus had plenty of time to complete any backups necessary.
    The *FIVE* Events that are affected seem to be the most recent ones, worked on the night before the MBP was stolen.

    I cannot say for certian but it is highly likley that YES, when the person finished editing they just closed the lid of the computer and didn't actually quit iPhoto. So would this explain why there are fragmenst of them in the backup (i.e. Events, keywords, thumbnails, etc.) but not the actual image files? Any way I can at least save the extremely low res thumbnail versions?
    I'm also going to try Data Rescue on the camera memory card to try and recover them that way.
    Thanks.

  • Would like to Downgrade OS, with a twist.

    Hi,
    Thanks for reading !
    The thing is i play games and recently ive come up against a brick-wall in that i cant play World of Warcraft, ok so its not gonna ruin my life but ...
    Anyway what happens is ( after either 10.4.9 / 10.4.10 ) login to game and maybe 5 mins after I will be disconnected from the game server. Not only that and this is the crunch, net connectivity is lost completely. No safari, skype, ventrilo ..nothing. On attempt to reconnect, `the other side is not responding`. Ive tried by direct ethernet and using a wireless router with no luck.
    As to how im writing this email, a restart of computer magically fixes it. The weird thing is that my IP address keeps changing, why that is i cannot say. Hence why i throw myself down upon the mercy of those who may understand it better than i do.
    The solution? Reverting to a previous version of the OS seems a good bet. I know it can be done using the Mac install cds. This brings me to the twist, the optical drive that came with my mac was great for a while but now is unable to read either cds or dvds ( and yes ive tried every brand under the sun ). Guess i got one of the bad ones there then. To avoid me just moaning >
    1) Can a downgrade be done without the boot cds?
    2) Would it just be better to get the drive fixed? ( im loathed to do this as i use it a great deal for work and it would be a big loss)
    I have an an external HD if that helps Im guessing that a reformat is in the offing but sob sob...
    Anyone any ideas about what the trouble is in any case??
    kind regards
    M.
    MacBook Pro 15"   Mac OS X (10.4.10)   2Ghz CoreDuo, 2Gb RAM

    I would concentrate on the changing the IP address rather than reinstall the OS! Can yo ugive anymore details on that? It is obviously where your issue lies. How is your network setup? Even if you have a very short DHCP lease, the router should try and redistribute the same IP address to you, so an every changing address is a problem.

  • Crosstab with multiple rowset xml content

    I have multiple rowsets (xml files) which I want to calculate subtotals from.  Each xml data set has identical columns.  If I union all the files together, the xml content contains multiple rowsets and the Crosstab function does not give me a summed value of each column, but instead it creates a column for each column in each rowset.
    The Normalize and the rowset combiner transform both combine rowsets by appending the second dataset into new columns, is there any way to append the data into new rows instead?
    Because my final file is going to have something over 30,000 rows (14Mb), I am reluctant to use a repeater on each row of each file to combine it into a new rowset.  Is there an efficient way to handle this calculation?

    Sue,
    I believe that we are off on the wrong foot here...all things aside...
    Join will work for your scenario when combined with other actions for your calculation and it will be easier to maintain than a stylesheet which will be beneficial to you in the end.  Please do not be too quick to judge the solution
    As for the error message that's one for support, what was the error in the logs?
    -Sam

  • Changing row colors in crosstab with static structure

    Hello,
    I've a crosstab that consists of several key figures (static structure) in the rows and the fiscal period in the columns:
    _____________|__January | February | March | .....
       Key Figure 1   |    3
    + Key Figure 2   |    4
    = Sub Total        |    7
    + Key Figure  3  |    1
    = Overall Total   |    8
    Now, I'd like to assign different (background) colors to the key figures resp. totals in the rows in order to make them better readable. Is this possible?
    I've already had a look at the custom style-sheet method described in http://scn.sap.com/community/businessobjects-design-studio/blog/2013/07/21/design-studio but that's not the same what I'd like to do...
    Does someone have an idea on how to realize this?
    Thanks and best regards,
    Patrick

    I have a question related to your last post.
    I have a crosstab layout. I have setup custom CSS for my learning purposes. I am currently using 1.4 in a local install on my PC.
    Here is the CSS I am using for the layout.
    .sapzencrosstab-DataCellAlternating {
    background-color: #CCFFCC !important;
    .sapzencrosstab-DataCellDefault {
    background-color: #EAF2D3;
    /* This defines how tall the rows will be in the cross tab layout*/
    .sapzencrosstab-DataCellContentDiv {
    height: 40px;
    /* This formats the Task Count with a gradient yellow*/
    .sapzencrosstab-DataCellTotal {
    font-weight: bold;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#E6E600',GradientType=0); background-color: rgb(229, 234, 243); !important;
    With the above CSS, I can get the Overall Result count to show up in yellow.
    My goal is to get the cell that contains the Overall Result text to show up formatted the same way the count is formatted. (Gradient Yellow)
    I looked at, and tried your solution, but it did not work for me. Is there a better way to do this?
    Thanks,
    Lloyd

  • Crosstab with char values doesn't work

    I am using Template Builder for Word 5.6.2 to create a crosstab report. I need to create a crosstab table that has char values in the cells not numbers as is expected by the wizard. Because the sum command expectes a number it displays the NaN not a number error in the cell if I try to display a char value. I tried changing the sum to max in the cell:
    <?max ($G1[(./CRITERIA_ID=current()/CRITERIA_ID)]/THRESHOLD)?>
    but this gives an error.
    Is is possible to display a char value?

    I ran into a similar problem before and worked around it by moving the query to a pipelined function in the database as described at WITH clause unexpectedly causes ORA-00942 in Reports Builder
    Hope this helps.

  • How to supress a subtotal in a crosstab with one row

    Hi,
    I have a crosstab report with three groupings and subtotals. In one group I only have one row and I want to supress the subtotal for that row. If I try to conditionally supress the subtotal it supresses all of the subtotals for the 3 groupings.  Any ideas?
    Thanks,
    Trish Leppa
    Jonh I. Haas, Inc.

    What I am trying to do is a cash flow report and the first group is 'Starting Cash' it has only one row so I want ot hid the subtotals. This is followed by two other groupings, Cash Receipts and Cash Payments. I'm doing this as a cross tab as the months will vary at runtime.
    I also tried adding the chas group as a calculated item, but I couldn't quite get that to work. I'm open to any other ideas.
    THanks,
    Trish

  • Crosstab with different users in JSP

    I need to switch the content of a crosstab in JSP depending on the user accessing it, i.e. some users see more dimension members while other users see less. Can anyone advise a good way of accomplishing this?
    Please note that I have managed to implement this fine grain security control in Analytic Workspace. I have also tested this in JDeveloper using the wizard with different database connections containing different username and password. They seem to work all right.
    I want to bring this into JSP using the orabi tag containing BISession and ThinCrosstab. I have been trying metadataManager, connection and query etc. but have made a mess. Everytime I switch the connection I lose the thincrosstab. Can anyone provide some codes to show how to accomplish this? Thanks.
    Wilson

    Thanks very much for your reply.
    I have looked at the forecast sample and did what you have suggested. The executeCommand works when I pass in an OLAP DML PERMIT command. However there is still a major problem. For example, if I have A, B, C, D selected in the crosstab as dimension members and my PERMIT command only allows the user to see A and B. I may get the following result with crosstab:
    Dim. Members Mesaure
    A $100
    B $200
    C
    D
    The user can only use the dollar amount assoicated with A and B which is right. However C and D still show even though they do not contain any dollar amount. Worse still, if I have not selected A and B originally in the crosstab, the user cannot see A nor B at all. The problem is not only do I need to determine what to put in the PERMIT command, I also need to know what to include in the "Selection" object of the crosstab so that the user will see all the members he/she is allowed to see.
    If I already know what to pass into the "Selection", the permit command seems redundant. This makes my search for a solution of fine grain security control coming to a full circle. I end up where I started from.
    I was looking for a solution which does not require me to pass in dimension members programmatically into the crosstab, and that the security control is not done on the application level, i.e. something akin to what can be achieved using VPD in relational database. I have been trying VPD in relational cube and Permit command in Analytic Workspace. They deliver what they claim to do in their respective environments. However, whatever I do in VPD seems useless in AW and whatever I do in AW do not seem to be very useful in BI Beans either. Would you please correct me if I am wrong? I would imagine someone must have this common requirement before and I wonder how they would fix it.
    I am still very confused about how Oracle implements fine grain security as the security in different layers (ie. relational cube, AW and BI Beans) do not seem to gel together. Thanks.

  • Create a crosstab with hierarchy in the middle with SDK

    Here is how our crosstab looks like:
    <Hierarchy>      |  <measure1>  |  <measure2> |  <measure3>
    -----------------------|---------------------|---------------------|----------------
    Level 1                |          254         |           212        |           22
      Level 1.1           |          200         |           111        |           14
        Level 1.1.1      |           54          |           101        |            8
    Level 2                |          13           |             0          |            0
    This is our requirement:
    <measure1>   |  <measure2>  |        <Hierarchy>       |  <measure3>
    --------------------|---------------------|------------------------------|----------------
             254         |           212        |          Level 1              |           22
             200         |           111        |             Level 1.1        |           14
              54          |           101        |              Level 1.1.1    |            8
             13           |             0          |         Level 2               |            0
    Is this possible (with SDK)?

    Thats possible, check the simplecrosstab demo of the sdk (renderTable function).
    You have to look up whether the
    dimension has
         members with
              hierarchy nodes
                   and levels,
    then render it the way you want

  • How to check for duplicates - with a twist?

    As I'm importing music from my CD collection, is there a way to automatically check for duplicates - with an unusual twist?
    I already imported about 70 CDs using AAC format.
    I just bought a huge external drive specifically for storing my entire collection of CDs and LPs. Now that I have lots of space, I want to import everything in Apple Lossless format.
    Is there an automatic (or at least painless) way to check for duplicates as I'm importing CDs, and to have the old AAC music files over written by the new Apple Lossless files?

    Hi Clinto,
    Do you see the column headers above in itunes? They say Title, Album, Artist, etc. I don't know if it's the same for MAC but in Windows, Right Click on the column headers and click "Kind". This will display the format each song is in. If your column headers already take up all of your screen, you're gonna have to uncheck one to make room for "kind".
    Oh! and to overwrite existing files, make sure the ID3 tags are filled exactly to the old ones prior to ripping, though you don't need to fill all of them. I think you just fill the Artist, Album Artist, Album, and Title. A window will appear as you start to rip. It will ask if you want to overwrite the existing files, click "Yes". Again, don't know about Mac but it works this way in Windows.
    Message was edited by: fullcream

  • Take account online to download message error WITH a twist

    Mail is telling me that "The message from _ concerning _ has not been downloaded from the server. You need to take this account online in order to download it."
    I've looked over many posts here about this problem, and many solutions involve moving the correlating .mbox folder to the desktop, re-opening mail, and rebuilding.
    Here's the twist - I can't find my .mbox file, or the mailbox in Mail, but I can find all the "non-downloaded" messages when searching from within Mail. All the messages, until today, were in the mailbox that is now missing.
    Where did my .mbox file go, and how can I restore the messages?
    24" Intel iMac   Mac OS X (10.4.10)   2.33 Ghz, 2GB RAM, 7600GT

    Have you checked whether the missing mailbox is within some other folder? If the mailbox is nowhere to be seen in ~/Library/Mail/ and Spotlight doesn’t find anything, that means the messages are gone and what you’re seeing in Mail are just the entries that remain in the index — Mail displays that bogus error messages because it cannot find the *.emlx file associated with the message where the index says it should be. Re-creating the index would “fix” the problem by getting rid of the phantom entries, but won’t make the messages reappear.
    Before doing anything, if the messages are gone and you don’t have a backup, you may try to salvage as many deleted *.emlx files as possible with a data recovery tool such as Data Rescue II, TechTool Pro, or FileSalvage. Of these, the only one I know for sure that can currently recover deleted *.emlx files is FileSalvage. Stop using your computer right now if you want to try that, as anything you do with the computer may cause the deleted files to be overwritten.
    You should also verify/repair the disk (not just permissions), as described in the following article, in case there is some filesystem corruption that has a bearing on what happened:
    The Repair functions of Disk Utility: what's it all about?

  • Motion on stills... with a twist

    I've read the posts about "motion on stills" (the "Ken Burns" effect) and found Shane's tutorial the most helpful. I have an added twist that I'm trying to figure out.
    I'm making video billboards for a real estate company. I've made the billboards in Photoshop and imported them into FCP. The billboards have the company name, address, etc. and a picture of the agent in the bottom right corner. What I'm trying to accomplish is having a smaller box in the upper right area which takes up around 25% of the screen. In that box I want to use the stills with the motion effect. The way that I figured out is to make the effect (the way Shane shows) in a seperate sequence, exporting it out as a .mov, shrinking it down to 25% and using that in my main sequence.
    Two questions...
    1. Is there a better way to do this?
    2. If not, what is the best video format to export my motion clip as? .mov as I've been using or another format? Which would look the best?
    Thanks for your help.
    James
    Quicksilver G4 Dual 800   Mac OS X (10.4.8)  

    The way that I figured out is to make the
    effect (the way Shane shows) in a seperate sequence,
    exporting it out as a .mov, shrinking it down to 25%
    and using that in my main sequence.
    Why export when you have unlimited layers to work with? You can either layer all of your media in one sequence, or if you'd like to keep part of your composite separated into its own sequence, you can simply nest that sequence in your main sequence. Avoiding an export saves time and keeps the sequence contents fully tweakable.
    Zap

  • Slow Safari with a Twist

    I've read through the "Slow Safari" posts, but haven't seen a problem exactly like mine...my Safari runs fast sometimes, slow other times, usually when I'm entering some kind of form.
    For example, no problem getting to Apple Support-->Discussions-->Safari
    But when I enter a search term (like "Slow") it never loads. Same with Google, Mapquest, my credit union web site.
    Any clue what's going on?
    (Here's the twist: I'm sending this message via my circa 1995 PowerMac 7600 running IE because I couldn't get Safari to work...)
    Thanks,
    elyse
    PowerBook G4   Mac OS X (10.4.5)  

    My problems are like yours... totally unpredictable. The forums are very slow. eBay for instance is usually slow if I can even get it to work. Everything else just totally varies. I have to refresh until it works and sometimes that doesn't even do it. I'm very frustrated with the whole problem. Like you, my old machines do not have these problems at all.

  • Can't Obseve/Control - with a twist

    Camping onto the "Can't Obseve/Control" thread started in February with an added twist... OS X Server 10.4.8
    I admin 2 PMG5s, 2 G4s, 2 iMacs from a PB15. I installed OS X Server 10.4 from the factory DVD. Since then, all the OSX machines remain responsive. The G5 running OS X Server, however, will not allow me to observe/control the screen (I can see via the ARD panel the machine status, even application changes in real time). The only VNC aboard the Server is "AppleVNCBundle" in the library (remove/do not remove?)
    I have deleted/recreated the ARD Administrator user on server and performed every other troubleshooting idea I can think of... still no resolution.
    Is anyone else using ARD with 10.4.8 Server successfully? If so, what is the key I am missing here? Thanks in advance!
    Phoop out.
    PMG5x2, G4x2, PB15x1, iMacx2   Mac OS X (10.4.8)   One PM G5 running OS X Server 10.4.8
    OS X 10.4.8 x6, OS X Server 10.4.8 x 1, ARD 3.1   Mac OS X (10.4.8)  

    See if iTunes can eject it.
    A Dozen ways to eject a CD/DVD...
    http://www.osxfaq.com/dailytips/08-2002/08-12.ws
    Might try this...
    >On your main hard drive, dig down into System > Library > CoreServices > Menu Extras. Inside that window, double-click on the icon called Eject.menu.
    http://www.creativetechs.com/tips/quicktips_51.html

Maybe you are looking for