Conditional Group_Concat_D with IF

Can anyone help me out here.
Trying convert a mysql conditional group_concat to TSQL GROUP_CONCAT_D (IF statement)
$view = $view." , GROUP_CONCAT(if(catalogitem_meta_attributeName  ='".$catalogitem_meta_attribute->getcatalogitem_meta_attributeName()."', catalogitem_meta_valueRawValue, NULL)) as '".$title."'
TSQL appears to have an issue with using IF
I am using the GROUP_CONCAT_D aggregate in TSQL 

You can kludge this violation of First Normal Form with loops, recursive CTE, or XML. Do not write crap code like that
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL

Similar Messages

  • Is it possible to create a Column with Conditional Mandatory with another Column?

    Is it possible to create a Column with Conditional Mandatory with another Column?
    For example
    In a Table we have column A, B, C.
    A is Primary Column.
    B is Optional
    C is Conditional Mandatory.
    A B
    C
    12345 ABC
    OK
    12346 NULL
    NULL
    12347 ABC
    OK
    Only if the B Column has the value then only C column should be mandatory

    I guess you can't create a condtional mandatory column directly. However, you can use check constraint to on the column
    create table YourTable
      A int primary key,
      B char(3),
      C int,
      constraint ch_con check(
                                B
    is not null
    or C is null

  • Pricing on PO - Condition type with formula

    Dear friends,
    I've one condition type with calculation type (KRECH) set as Formula.
    For the calcutation of this condition I need to set this formula: Value = (Gross Price + Freight) * 0,0035
    Can you please tell me how can I se this condition as required?
    Thanks in advance,
    Afonso Pereira

    Hi
    I have never tried this calculation type - G formula,
    But in the pricing procedure config, there is a field Caclulation type whcih is used as Alternate calculation type.
    You can createa new routine ( nothing but a logic based formula) for caclutaion and assign that to the new condition type.
    This will ensure that if your gross price condition and freight are present then this condition type gets automatically calculated and get populated in the PO conditions.
    For routine creation you need to take help of Abaper.
    Routines are craeted in transaction VOFM
    Thanks & Regards
    Kishore

  • Create condition record with reference to existing condition record

    how to create condition record with reference to existing condition record?

    Hi,
    See this link :
    http://help.sap.com/saphelp_47x200/helpdata/en/de/7a8534c960a134e10000009b38f83b/frameset.htm
    You can create with reference with Tcode : VK14 (or VK34)
    Or in VK12, you can copy condition records with copy rules.
    Regards,
    Lionel

  • VF03: Condition type with no account key is posted to accounting

    Hi,
    I have one condition type JA1Y for which no Account Key is maintained in the pricing procedure.But in VF03 I am able to see JA1Y along with other condition types with account keys.
    Under JA1Y there are 5 line items & I have a message
    "No G/L account found in Account determination type KOFI"
    How can it be possible? How can I avoid this?
    Helpful answers will be rewarded.
    Thanks & Regards
    Swathi

    Hi,
    You have to maintain account determination:
    SPRO -> Sales and Distribution -> Basic Functions -> Account Assignment/Costing -> Revenue Account Determination -> Assign G/L Accounts.
    Here you have different ways of assign an account. Many of them use key account, but others not. Also, you can define your own access sequence.
    Regards.
    Points if it helped you.
    Ángel Rubio.

  • Conditional Branching with quiz slides not working

    Attempting to use conditional branches with quiz slidescauses
    the other quiz slides in my presentation to not work correctly. I
    am attempting to create a 'test-out' pre-quiz for a segment of
    slides in the presentation. I followed the instructions to add
    conditional branching per page 46 of the Breeze Presenter User
    Guide to obviously no avail. Is there a simple straightfoward
    manner in which someone has successfully used conditional branches
    with their quiz slides in their presentation?

    Hi,
    I had the same issue.Apparently as of now PDF templates do not support conditional formatting for XML Publisher.
    See Tim Dexter's response to my query at the bottom of this thread...
    Re: Using the '%' operator in microsoft word template builder for XMLP
    I could get some conditional formatting to work on the pdf template but only for the form field font,size and styles using Javascript, but I don't think there is a way to display values for the form field based on an if condition...
    Lavina

  • Freight condition type-With respect to Delivery Item (per PC)/Volume/Ship-to party 's region

    Hi Gurus,
    I am working on freight related condition type,my requirement is we have to calculate freight cost based on Delivery Item (per PC) / Volume of that Material (Per PC) and Destination Region of each Delivery Order.
    for example:
    If Material '100001' has volume = 1 M3 per PC and Destination region code (in Delivery Order) is '20'. The Freight cost is 1 USD per PC.
    If Material '100001' has volume = 1 M3 per PC and Destination region code is '22'. The Freight cost is 1.5 USD per PC.
    If Material '100002' has volume = 1.5 M3 per PC and Destination region code is '20'. The Freight cost is 2 USD per PC.
    If Material '100002' has volume = 1.5 M3 per PC and Destination region code is '22'. The Freight cost is 3 USD per PC.
    I'm try to set calculation type = 'T - Multi-dimensional' and having 2 Scale Basis as following:
    Scale Basis = 'F - Volume'
    Scale Basis = 'L7 - Region of Destination'
    but it result in error in calculation when creating Shipment cost document. 
    I don't sure whether my understanding on Multi-dimensional scale is correct or not. Please kindly help.
    Thank You in Advance for every idea.

    I think, from your example, if you maintain condition record with the combination of Destination Region Code and Material, it will work, provided, your freight condition type has Calculation Type as "C".
    So your condition record would be
    100001 / 20  =  1USD per PC
    G. Lakshmipathi

  • Pricing - Manual Condition Type with value = 0

    Hi gurus,
    I need to insert a manual condition type with value = 0 into the billing data set.
    I realize that if its valiue is 0 it is not active.
    Anyone knows how to make it active despite its value = 0?
    Thank you.

    Dear Customer,
    if you have customized the condition as price then the condition will be inactive if the condition is set to zero.
    This is calling in:
    LV61AA55                                                                               
    inactivate prices with rate / condition value zero                   
          if xkomv-koaid eq 'B' and xkomv-kbetr eq 0 and komp-kposn ne 0 and 
             xkomv-kgrpe eq ' ' and xkomv-kinak ca ' Y' and xkomv-kwert eq 0 
             and xkomv-kntyp ne 'e' and komp-fareg na '45'.                  
            xkomv-kinak = 'X'.                                               
          endif.                                                             
    If you need an active condition with value zero, then the condition class should not be 'B' (price)
    I hope that the information are helpful.
    regards
    Claudia

  • Financial Reporting - don't work condition "starts with"

    Hi All,
    I want exclude rows from report where dimension members name start with "9", I try suppress row with condition "starts with", but this don't work.
    When I explore Conditional Suppression feature I got positive take only for "contains" condition.
    Please help me how I can exclude rows from my report.

    I make sense, condition "starts with" work perfect, error in hierarchy on my dimension.
    Hyperion Financial Reporting the best :8}

  • Overwrite the system calculated VAT - Condition Value with Inbound VAT Amou

    Hello experts:
    We have a following requirement in my customer for Inbound VAT Processing.
    We want to overwrite the system calculated VAT - Condition Value with Inbound VAT Amount
    Details :
    Aggregated sales Idoc ( WPUUMS01) is used here for posting the daily sale.
    Inbound pricing procedure is ZPOS00 ( copy of POS000)
    VAT is maintained with condition Type ZMWS. Using Tax Codes
    When idoc get posted system calculates the ZMWS and working fine.
    However we would like to overwrite this condition value with inbound condition value (from segment 5 of WPUUMS)
    Example :
    For Article A : inbound aggregated sales Amount= 100 INR and ZMWS is 10%( VAT code B1)
    Then system will calculate 90 INR revenue and 10 INR as VAT
    However due to rounding in POS system we may get from POS the VAT Amount =9.99 for example.
    Tisak wants to overwrite the condition value 10 INR with 9.99 INR.
    I will appreciate if anybody can suggest some approach or share experience if came across the same scenario (Tax condition type).
    Thanks and regards,

    Hi,
    Either you can use rounding in POS such that it round up for 9.99 to 10.
    And then in SAP pricing procedure you can use alternate calculation type as 16 or 17 (17 should be used with decimal point assigned to currency for rounding like 2 decimal for INR).
    doing this will also round the figure from 9.99 to 10 is SAP.
    Hope this solves your query.
    Regards,
    Ashutosh

  • Show days left until reset based on date and condition associated with date

    My question is simlilarly based to the previous discussion https://discussions.apple.com/message/15134714#15134714
    What I need to do is display the number of days until I have to reset a flight condition (FS Column) based on a set number of days (60 days).  I have several colums of information but the two I would use is a Date Column and the FS Column(drop down menu with text for options). I would need to be able to look at certain FS options and use the date associated with it to subtract from 60.
    If FS= "NG" use date associated with it to add 60 days, and then use that date to compare it with today's date to show how many days are left till the 60 day mark.
    So if the last "NG" was Jan 1, 2011 and today was Feb 1, 2011 I would want one cell to show 30 days and another cell to show Mar 2, 2011.
    I need to fly in a certain condition once every 60 days. I want to show how many days left I have until I need to reset that 60 day counter.  Also, I would like to have another cell show the date associated with the day I would need to reset that counter on.
    Unfortunately I am in a limited internet environment so I can not post a picture of my spreadsheet.  Sorry for the over explination, trying to make it as clear as possible first go round.
    Thanks in advance!

    Aron,
    I added a few columns to correlate the conditions and dates. There may be a better way than this brute force approach, but this will work.
    Date
    DS
    FS
    Hrs
    Seat
    Mission ID
    D
    H
    N
    NG
    NS
    Aug 1, 2011
    PI
    D
    1.0
    F
    C
    8/1/11
    Aug 1, 2011
    PI
    N
    0.5
    F
    C
    8/1/11
    Aug 2, 2011
    PI
    D
    0.5
    F
    C
    8/2/11
    Aug 2, 2011
    PI
    NS
    1.4
    F
    C
    8/2/11
    Aug 4, 2011
    PI
    NS
    0.2
    F
    C
    8/4/11
    Aug 12, 2011
    PI
    NG
    1.0
    F
    C
    8/12/11
    Aug 12, 2011
    PI
    NS
    1.2
    F
    C
    8/12/11
    Aug 14, 2011
    PI
    NG
    0.5
    F
    C
    8/14/11
    Aug 14, 2011
    PI
    H
    0.5
    F
    C
    8/14/11
    Aug 14, 2011
    PI
    NS
    0.6
    F
    C
    8/14/11
    Aug 20, 2011
    PI
    NS
    2.1
    F
    C
    8/20/11
    Aug 21, 2011
    PI
    NG
    2.0
    F
    C
    8/21/11
    Aug 22, 2011
    PI
    NG
    1.0
    F
    C
    8/22/11
    Aug 22, 2011
    PI
    NS
    0.4
    F
    C
    8/22/11
    Aug 29, 2011
    PI
    NS
    0.5
    F
    C
    8/29/11
    Then I added a summary table:
    FS Condition
    LastDate
    Plus 60 Days
    Today is Oct 11, 2011
    Alarm
    D
    8/2/11
    10/1/11
    10d
    Overdue
    H
    8/14/11
    10/13/11
    -2d

  • Conditional Formatting with multiple characteristics in report designer

    Hi,
    I'm trying to build a report with images in conditional formatting for two characteristics (=columns). Each of which can have one of the following three status values:
    1 - green
    2 - yellow
    3 - red
    For each status value i want to show a different image (traffic light). It works fine with only one characteristic. The conditional formatting creates three details rows in the row pattern (one for each status value) and depending on the status value the corresponding details row with the traffic light is shown.
    But if there is more than one characteristic with conditional formatting in the report it only works with a different row for each characteristic value, as the two characteristics belong to different group levels of the row pattern. That means I finally have 2 rows showing the two status values.
    To show them all in one row, which is the goal, I have  put all the conditional formatting definitions (6=3 for each characteristic) into the detail rows of the row pattern.
    But then for one characteristic incorrect images are shown, e.g. although the status value is red, a green traffic light is displayed, because the status value of the other characteristic is green.
    Obviously the conditional formatting only works with the characteristic, for which the details rows in the row pattern have been created.
    Any ideas how I can manage to show all the conditional images in one row?
    Thanks in advance.
    Regards,
    Sven

    Sven,
    your scenario is not supported yet.
    Right now, a conditional format is based on one condition.
    In the future it is planned to allow more conditions to be applied to the rowpattern, using "AND, OR" operators.
    The availability of the feature will be announced via the BI Functional Enhancement List (see BIFAQ)
    regards, karim

  • Transfer condition values with +/- signs to CO-PA (Explain the purpose)

    Dear Sap guru's,
    Could you please guide me on the below issue, We make a new condition type zne1 which is excise duty free items, Based on  cleint requirement.  a/c entry like this ( example )
    10) 210 ea            net value 23,153.04  cost 21,600.00
    20) 0  ea              net value 0               cost 2400
               Customer AC           DR  20163 Rs
               Excise duty payble   Cr  432 -
               Sales                      Cr  22721-
               vat payable              cr  3010-
               excise duty payble   cr 48-
               Excise duty free       cr 48-
               Excise duty free       dr 48
               sales                       dr 48
    Here client pay the excise duty for free goods issue items, For this situation what ever the amount he paid in the excise duty free item that same amount he wants to reduce in sales ie it should be debit in my exaple it is 48 rs.
    My problem is i configured ZNE1 condtion assgined to value filed ERLOS. While release to a/c system returns  "CHEK VALUE FILED ASSIGNEMENT TO CONDITION TYPE". when I make the settings +/- sign for the conditon system allow me to release and save. Please guide me whithout assignment how to release billing document?
    Regards
    Maruthi

    Hi
    Conditions from SD are always transferred to CO-PA with "+" signs, with the exception of credit memos and returns. The reasons for this is that the signs for revenues are handled differently in the different applications of the R/3 System. For example, revenues are positive in SD, while they are negative in FI. Consequently, CO-PA accepts all the values as positive, and then subtracts deductions and costs from revenues in the information system.
    This configuration needs to be done in the system if you have the CO-PA active and the SD flows are configured. Unfortunately you will not be able to ignore this. Please see below some SAP help snippets for your benefit.
    Note that certain limitations exist on the transfer of condition values of billing documents to CO-PA.
    1. To transfer condition types for sales revenues and sales deductions to CO-PA, you need to make sure that the condition types and linked to an account in FI that is also defined as a cost element of the category "11" (revenue element) or "12" (sales deduction) in CO. These condition types must be assigned to a CO-PA value field.
    Condition types linked to FI accounts that are defined as cost elements of another category are not transferred to CO-PA, even when the condition type has been assigned to a CO-PA value field.
    2. Condition types such as "VPRS" ("Cost") that are defined as statistical in SD are always transferred to CO-PA if they are assigned to a value field.
    3. All condition types that you want to transfer to CO-PA must be active in the SD pricing procedure. Inactive conditions in a billing item are not transferred. If all the conditions in a billing item are inactive, that item is not transferred to CO-PA.
    Conditions do not need to be active, however, to be transferred with sales order items, since the transfer of incoming sales orders is always statistical.
    It is also possible to transfer conditions from MM to update billing data in pooled payment in the IS Retail system. These are transferred according to the same rules as SD conditions
    Hope it was helpful.
    Karthik

  • How to send a conditional email with interactive report subscription

    Hi,
    i have an interactive report with subscription.
    I would like to send an email with the attachment only when the query returns one or more records.
    How to to this?
    Apex 4.0.2
    Thanks in advance
    lukx

    Well, to understand your requirements can I ask this:
    You said earlier you want a report sent whenever records that meet a criteria exist, correct? So you want the application to query for a condition, and when that condition occurs (a row with primary Key = X, a select COUNT(1) for rows with column X returns a result of 1 or more)
    Then you would schedule a batch job:
    BEGIN
    -- Job defined entirely by the CREATE JOB procedure.
    DBMS_SCHEDULER.create_job (
    job_name => 'Send_Email_Procedure',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN Test_For_COND_SEND(); END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'freq=hourly; byminute=0',
    end_date => NULL,
    enabled => TRUE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    END;
    This would in theory run hourly and run your test_for_cond_Send process, in which you would test for the condition and send an e-mail if it was found that would contain the results from your query/report.
    Here is a link to generate a PDF report that could be sent via e-mail: Re: how to save pdf in APEX 3.0
    Thank you,
    Tony Miller
    Webster, TX
    While it is true that technology waits for no man; stupidity will always stop to take on new passengers.

  • Conditional format with large data fails and show error as "Selection is too large" in Excel 2007

    I am facing a issue in paste special operation using conditional formats for large data in Excel 2007
    I have uploaded a file at below given location. 
    http://sdrv.ms/1fYC9qE
    The file contains two sheets, Sheet "Data" contains the data on which formats are to be applied and sheet "FormatTables" contains the format tables which contains conditional formating.
    There are two table in "FormatTables" sheet. Both have some conditional formats applied on it. 
    Case 1: 
    1. Select the table range of Table1 i.e $A$2:$AV$2
    2. Copy it
    3. Goto Sheet "Data" 
    4. Select data area i.e $A$1:$AV$20664
    5. Perform a paste special operation on full range and select "Formats" option while performing paste special.
    Result:
    It throws error as "Selection is too large"
    Case 2:
    1. Select the table range of Table2 i.e $A$5:$AV$5
    2. Copy it
    3. Goto Sheet "Data" 
    4. Select data area i.e $A$1:$AV$20664
    5. Perform a paste special operation on full range and select "Formats" option while performing paste special.
    Result:
    Formats get applied successfully.
    Both are the same format tables with same no of column and applied to same data range($A$1:$AV$20664) where one of the case works and another fails.
    The only diffrence is Table1 has appliesTo range($A$2:$T$2) as partial of total table range($A$2:$AV$2) whereas the Table2 has appliesTo range($A$5:$AV$5) same as of its total table range($A$5:$AV$5)
    NOTE : This issue is only in Excel 2007

    Excel 2007 No Supporting formating to take a formatting form another if source table has more then 16000 rows and if you want to do that in more then it then you have ot inset 1 more row in your format table to have 3 rows
    like: A1:AV3
    then try to copy that formating and apply
    Solution Case 1: 
    1.Select the table range of Table1 i.e AV21 and drage it down to one row down
    2. Select the table range of Table1 i.e $A$2:$AV$3
    3. Copy it
    4. Goto Sheet "Data" 
    5. Select data area i.e $A$1:$AV$20664
    6. Perform a paste special operation on full range and select "Formats" option while performing paste special

Maybe you are looking for