Query on Calculated Column

Hi Frzz,
I have created one calculated column. In which i have to check the condition as
IF ( "PTYPE" = 'OR', "PTYPE",'')
But when am activating the view its hanging up. The value 'OR' is key word inHANA. Is that is the reason??
Best Regards,
Krishna.

Hi Fernando,
Thank you.
But if you see the screen, OR is highlgihted in Calculated Column Editor, which means it is considering OR as key word??

Similar Messages

  • Query a calculated column

    In a report I have used the source area to create a query that uses/creates calculated columns.
    Query:
    Select id, name, amount, percentage,
    amount * percentage AS CalCost
    from store
    where id = 3;
    Now I want to create another calculated column within that query using the created 'CalCost' column, similar to:
    Select id, name, amount, percentage,
    amount * percentage AS CalCost,
    amount - CalCost AS Difference,
    however, i get the ORA-0094 error stating that 'CalCost' is an invalid identifier.
    Is there any way to calculate this column without raising this error??

    963510 wrote:
    however, i get the ORA-0094 error stating that 'CalCost' is an invalid identifier.
    Is there any way to calculate this column without raising this error??Yes -- the alias isn't available from within the SELECT list. You'd have to redo the calc, i.e.:
    SELECT id, name, amount, percentage,
           amount * percentage AS CalCost,
           amount - (amount * percentage) AS Difference
    FROM   store
    WHERE  id = 3;Alternately, you could rewrite it as follows, where the alias would be available, but I see no reason to:
    SELECT id, name, amount, percentage, CalCost
           amount - CalCost AS Difference
    FROM   (SELECT id, name, amount, percentage,
                   amount * percentage AS CalCost,
                   amount - (amount * percentage) AS Difference,
            FROM   store
            WHERE  id = 3
           );

  • How to use a calculated column in the same query

    Hi All,
    I need some help with using a calculated column in the same query.
    For eq
    I am joining a couple of tables and some of the select columns are calculated based on the columns of the tables and i want a new column in the same query to use this calculated feild in some other calcualtion.
    something like this...
    select (12+3) as Sum1, (12-3) as Sum2, (Sum1 + Sum2 ) as Sum3
    from dual
    or
    select (12+3) as "Sum1", (12-3) as "Sum2", CASE WHEN ( "Sum1" / "Sum2" * 100 > 0 ) THEN 'Yes' ELSE 'No' END
    from dual
    Thanks

    user548171 wrote:
    select (12+3) as Sum1, (12-3) as Sum2, (Sum1 + Sum2 ) as Sum3
    from dual
    or
    select (12+3) as "Sum1", (12-3) as "Sum2", CASE WHEN ( "Sum1" / "Sum2" * 100 > 0 ) THEN 'Yes' ELSE 'No' END
    from dual
    ThanksWhat about just repeating the column values:
    select (12+3) as "Sum1", (12-3) as "Sum2", CASE WHEN ( (12+3) / (12-3)  * 100  > 0 )  THEN 'Yes' ELSE 'No'  END FROM DUAL

  • Performance issue: View query is calculating a column value before filterin

    Hi,
    I have a view like this.(My view is more complex than this..I just tried to imitate the situation )
    Select emp_id, emp_name, calculate_salary(emp_id) salary
      From employees
    Where nvl(department, '@@##$$') = nvl(get_global.department, '@@##$$')When I execute the below query
    select emp_name from my_view where salary=10000 by setting a value to get_globals.department I found that it first calls the calculate_salary instead of applying the filter for departments. By somehow the cost base analyzer thinks that calling the function is cheaper than applying the filter. I wonder whether there is way to direct the cba and say to first apply the filters before calculating column values.
    Any suggestions ?
    Thanks

    I don't think it's possible.
    Before a WHERE clause can be applied the data has to be collected for the row so Oracle, I would imagine, isn't going to differentiate between what is a database column and a function, fetch just the columns, do the filtering and then go back to calculate the rest of the columns; it's just going to get all the columns, including the calculated ones, and then apply the filters.
    The only option would be to do...
    select emp_id, emp_name, calculate_salary(emp_id) salary
    from (select emp_id, emp_name
          from employees
          where nvl(deparment, '@@##$$') = nvl(get_global.department, '@@##$$')
          )as your view

  • Can you have a calculated column in a table not a view?

    We have a table which contains a series of rows
    Key   Effective Date   Value
    1       10/Feb/2006     123
    1       23/Oct/2006      456
    ...We have a requirement to store an indicator that tells us which row is the most current and what the end date of the preceding row was so that we get something along the lines of:
    Key   Effective Date   Value   Status         End Date
    1       10/Feb/2006     123      HISTORY    22/Oct/2006
    1       23/Oct/2006      456     CURRENT   NULL
    ...I can produce this result quite easily using the analytic function LEAD. My question is, is the answer to this problem to create a view over the table that includes the analytic function or is it possible to define a calculated column in a table that would populate/maintain this vale as part of a table definition?
    And as I finish writing this I feel I've answered my own question but hey, there's no harm in asking how others have handled this kind of situation.
    Cheers
    Richard

    My bias would be to create a view that did the calculation.
    In theory, you could add those additional columns to a table and maintain the data via a set of triggers, but that would be substantially more complicated than the alternatives for little or no benefit.
    A third option would be a materialized view. That might be easier to deal with if you want to have different indexing strategies for current and historical records or if the historical data is queried often enough and updated infrequently enough that it ends up being cheaper to do the calculation once during the update rather than every time the query is run.
    A fourth option would be to use stored procedures to maintain the data and have that stored procedure expire the current row and add the new row.
    Finally, you might consider version-enabling your table using Workspace Manager rather than writing your own code since Oracle has already written all this code for you.
    Justin

  • Strange error in Discoverer calculated columns.

    Hi,
    I got a strange error in discoverer10g worksheet. In woksheet the calculated coulmns did not return data but in PL/SQL developer when I run the query taking from the Show SQL of Discoverer Worksheet it returns. Anyone please help me to resolve this problem.
    I paste the show sql discoverer query below:
    SELECT /*+ NOREWRITE */
    O378524.NAME AS E394898,
    O397424.COMPANY AS E397430,
    O397424.SEGMENT1 AS E397431,
    O397424.INV_ORG AS E397433,
    O397424.VENDOR_NAME AS E397435,
    O397424.INVOICE_ID AS E397436,
    O397424.PERIOD_NAME AS E397438,
    O397424.AMOUNT_PAID AS E397439,
    DENSE_RANK() OVER(PARTITION BY O397424.ORG_ID ORDER BY O397424.AMOUNT_PAID DESC) AS C_5,
    (SUM(O397424.AMOUNT_PAID)
    OVER(PARTITION BY O397424.ORG_ID ORDER BY O397424.AMOUNT_PAID DESC ROWS
    UNBOUNDED PRECEDING)) /
    (SUM(O397424.AMOUNT_PAID) OVER(PARTITION BY O397424.ORG_ID)) AS C_4,
    SUM(O397424.AMOUNT_PAID) OVER(PARTITION BY O397424.ORG_ID ORDER BY O397424.AMOUNT_PAID DESC ROWS UNBOUNDED PRECEDING) AS C_1,
    O397424.AMOUNT_PAID /
    (SUM(O397424.AMOUNT_PAID) OVER(PARTITION BY O397424.ORG_ID)) AS C_3,
    SUM(O397424.AMOUNT_PAID) OVER(PARTITION BY O397424.ORG_ID) AS C_2
    FROM (SELECT * FROM APPS.HR_OPERATING_UNITS) O378524,
    (SELECT DISTINCT /*SEGMENT1*/ CODE_COMBINATION_ID, INV_ORG
    FROM (SELECT GCC.SEGMENT1,
    GCC.CODE_COMBINATION_ID,
    DECODE(GCC.SEGMENT1,
    7590,
    'Kanowna Belle Organisation',
    7060,
    'Darlot Organisation',
    7260,
    'Cowal Organisation',
    7570,
    'Kanowna Belle Organisation',
    7595,
    'Kundana Organisation',
    7070,
    'Lawlers Organisation',
    7180,
    'NULL for Yilgarn(Barrick (Services) Limited)',
    7541,
    'Granny Smith Organisation',
    7015,
    'NULL for Barrick Gold(Barrick (Australia Pacific) Limited)',
    7610,
    'Kundana Organisation',
    7014,
    'NULL for Yilgarn(Yilgarn Shared Services)',
    7538,
    'Granny Smith Organisation',
    'Unknown') INV_ORG
    FROM APPS.GL_CODE_COMBINATIONS GCC)
    /*WHERE SEGMENT1 IN
    (7590, 7060, 7260, 7570, 7595, 7070, 7180, 7541, 7015, 7610, 7014, 7538)*/
    ) O394875,
    (SELECT CHQ.ORG_ID,
    FVT.DESCRIPTION COMPANY,
    GCC.SEGMENT1,
    INVD.DIST_CODE_COMBINATION_ID,
    DECODE(GCC.SEGMENT1,
    7590,
    'Kanowna Belle Organisation',
    7060,
    'Darlot Organisation',
    7260,
    'Cowal Organisation',
    7570,
    'Kanowna Belle Organisation',
    7595,
    'Kundana Organisation',
    7070,
    'Lawlers Organisation',
    7180,
    'NULL for Yilgarn(Barrick (Services) Limited)',
    7541,
    'Granny Smith Organisation',
    7015,
    'NULL for Barrick Gold(Barrick (Australia Pacific) Limited)',
    7610,
    'Kundana Organisation',
    7014,
    'NULL for Yilgarn(Yilgarn Shared Services)',
    7538,
    'Granny Smith Organisation',
    'Unknown') INV_ORG,
    CHQ.VENDOR_ID,
    CHQ.VENDOR_NAME,
    COUNT(INV.INVOICE_ID) INVOICE_ID,
    --INVL.PRODUCT_TYPE,
    INVL.PERIOD_NAME,
    --chq.check_date,
    SUM(NVL(INVP.PAYMENT_BASE_AMOUNT, INVP.AMOUNT)) AMOUNT_PAID
    FROM APPS.AP_CHECKS_ALL CHQ,
    APPS.AP_INVOICE_PAYMENTS_ALL INVP,
    APPS.AP_INVOICES_ALL INV,
    APPS.AP_INVOICE_LINES_ALL INVL,
    APPS.AP_INVOICE_DISTRIBUTIONS_ALL INVD,
    APPS.GL_CODE_COMBINATIONS GCC,
    APPS.FND_FLEX_VALUES FV,
    APPS.FND_FLEX_VALUES_TL FVT
    WHERE CHQ.CHECK_ID = INVP.CHECK_ID
    AND INVP.INVOICE_ID = INV.INVOICE_ID
    AND INVL.INVOICE_ID = INV.INVOICE_ID
    AND INVL.LINE_NUMBER =
    (SELECT MIN(LINE_NUMBER)
    FROM APPS.AP_INVOICE_LINES_ALL
    WHERE INVOICE_ID = INVL.INVOICE_ID
    AND LINE_TYPE_LOOKUP_CODE = 'ITEM'
    AND DISCARDED_FLAG = 'N')
    AND INVL.INVOICE_ID = INVD.INVOICE_ID
    AND INVL.LINE_NUMBER = INVD.INVOICE_LINE_NUMBER
    AND INVD.DISTRIBUTION_LINE_NUMBER = 1
    AND INVD.DIST_CODE_COMBINATION_ID = GCC.CODE_COMBINATION_ID
    AND FV.FLEX_VALUE_SET_ID = 1013043
    AND FV.FLEX_VALUE = GCC.SEGMENT1
    AND FV.FLEX_VALUE_ID = FVT.FLEX_VALUE_ID
    GROUP BY CHQ.ORG_ID,
    GCC.SEGMENT1,
    CHQ.VENDOR_ID,
    CHQ.VENDOR_NAME,
    FVT.DESCRIPTION,
    --INVL.PRODUCT_TYPE,
    INVL.PERIOD_NAME,
    --chq.check_date,
    INVD.DIST_CODE_COMBINATION_ID) O397424
    WHERE ((O397424.ORG_ID = O378524.ORGANIZATION_ID) AND
    (O397424.DIST_CODE_COMBINATION_ID = O394875.CODE_COMBINATION_ID))
    AND (O397424.AMOUNT_PAID > 0)
    AND (O397424.PERIOD_NAME = /*:"Period"*/'DEC-09')
    -- AND (O394875.INV_ORG = :"Inv Org")
    AND (O378524.NAME = /*:OU*/'Barrick Yilgarn')
    ORDER BY O397424.AMOUNT_PAID DESC;
    Edited by: Soma Sekhar D on Feb 24, 2010 11:46 AM

    Hi,
    In the report I have two worksheet. The Ist worksheet has the same calculated columns as 2nd worksheet. Even the calculations are also the same. The only difference is I use different folder for the 2nd worksheet. For 2nd worksheet layout only the calculated columns will not display the result.The other columns displayed the result properly. Even in the Ist worksheet all the columns including calculated columns displayed the result correctly.The calculations are same in the 2nd worsheet with calculation names different and items coming from different folder. As these calculations are working properly in Ist worksheet,why its not appearing in the 2nd worksheet? The query I paste before is the Discoverer show sql query for 2nd worksheet.
    Please help.

  • How to improve slow PowerPivot performance when adding/modifying measures, calculated columns or Relationships?

    I have been using PowerPivot for a couple of months now and whilst it is extremely quick when pulling in data to populate Pivot Tables, it is extremely slow to make the following kind of changes to the Data Model:
    - Add a Measure / Calculated Field
    - Add a Calculated Column
    - Rename a Calculated Field
    - Re-name a Calculated Column
    - Modify a relationship
    - Change a tables properties
    - Update a table
    In the status bar of excel I get a very quick 'calculating', then it spends a lot of time 'reading data',
    then it 'finalises' after which nothing is in the status bar but it still takes approx. 45 seconds before the program becomes responsive again. This waiting time does not change depending on the action, it is the same if I rename a
    column as it is if I add a new measure.
    My question is what affects performance of these actions and how do I improve it?
    To give you an idea of where my data comes from, I have:
    - 7 tables that feed into the Data Model directly from within the workbook which contains the data model itself. These are a combination of static tables and tables that connect to a MySQL database.
    - 6 separate workbooks which contain static data that is updated manually periodically (copied and pasted from another source)
    - 5 separate workbooks which contain dynamic tables that are linked to our MySQL database and update when opened.
    Now I realise that this is probably where my issue is, however I have no idea how to fix it. You do not seem to be able to connect to a MySQL database directly within the PowerPivot window itself so there is no way to generate and update tables without
    first creating them either in a worksheet or separate workbook (as far as I know).  If I try to create all of the tables directly within the single workbook containing the Data Model I get performance and crashing issues hence why I separate tables into
    individual workbooks.
    Any advice on how to improve performance would be tremendously appreciated. I'm new and keen to learn, I'm aware this set-up is far from best practice.
    Hardware wise I am using:
    - Windows 8 64-bit
    - Excel 2013 64-bit
    - Intel Core i7 processor
    - 6 GB Ram
    Thanks,
    James

    Darren,
    I think the point I was making is its in memory, geez... BTW what do all applications do when they run out of paged memory,  if PowerPivot is using all available memory then wouldn't this force the other applications to use Virtual or essentially write
    back and forth to the disks? I think Virtual memory white to disk ??, lol Also, there are parts if the architecture of Excel 2013 that when importing data into PowerPivot require memory and when working in SharePoint the PowerPivot data is cached to disk
    unless recently refreshed... But this conversation isn't help the James who asked the question and as much as I would love to continue its become a little boring..
    Hi James,
    If you download one the ODBC MySQL Connectors
    http://dev.mysql.com/downloads/connector/odbc/ and I believe yours is the first one for x64 systems and connect directly to the data you should be able to reduce the number of workbooks your opening and if you notice in the following graphic these
    connection are automatically refreshed by default, the parts in red are the differences between PowerPivot 2010 and 2013
    You should notice a lot of improvement especially when refreshing data please let us know how it goes...
    After registering the ODBC Driver
    Click Add. on the User-DSN sheet, choose the “MySQL ODBC 5.x driver”, fill in the credentials, choose a database (from the select menu) and a data source name and you’re done.
    Back in Excel you go on the PowerPivot section of the ribbon and open the PowerPivot window  (the green icon on the left side). In the ‘Home’ section of that window you will see a small gray cylindrical symbol (the international
    symbol for “database”) which will suggest to you different data sources to choose from. Take the one where it says “ODBC”.
    In the next dialog you click on create, choose the adapter, and then Ok. Back in the assistant you can check the connection and proceed.
    Now you have the choice between importing the data from tables using the import assistant or Query depends on your skillset..
    Cheers,
    Ivan
    Ivan Sanders <a href="http://www.linkedin.com/in/iasanders">My LinkedIn </a> , <a href="http://msmvps.com/blogs/ivansanders">My Blog</a>, <a href="http://twitter.com/iasanders"> @iasanders</a>,
    <a href="http://shop.oreilly.com/product/0790145372703.do">BI in SP2013</a>, <a href="http://sharepointdemobuilds.codeplex.com">SP2013 Content Packs</a>.

  • Using ODBC how do you identify a calculated column in a table?

    I've a calculated column in my table. Is there a way to identify that column through ODBC functions? I need to identify the  calculated column and make it read only. The function should support both SQL and Access databases. Please let me know if
    there is a way to find out this column type.

    Hello,
    You can refer to the following article which list some ODBC Scalar Functions which you can used in the T-SQL query statement.For example
    SELECT {fn TRUNCATE( 100.123456, 4)};
    -- Returns 100.123400
    Reference:http://msdn.microsoft.com/en-us/library/bb630290.aspx
    As per my understanding, there is no built in declarative support for read-only columns. You can try to create a UPDATE trigger to achieving this. Or you can create a view with derived column  from the source table. And then users cannot
    update this calculated column on the view.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • SAP BEX Calculated Column

    Hi ,
    I would like to thanks to all who helped me in getting my work done for my previous questions.
    This time i came up with some new questions ... is there a way to create a calculated column in the SAP BEx query ? I dont have global query edit permissions but i can chage the Local View of the query.
    1 )
    I have a Original Hire Date and Most Recent Hire Date as two columns in the BEX Query, when i refresh the query it will populate in tow different columns which is usual. But, i would like to combine these two DATE columns (based on some criteria) as one and want to produce as a single DATE columns.
    would it be possible... ?
    2)
    I have two query's in a workbook and the first query will give the employees ID's which i have import in the second query. Is ther any way to import these ID's in to Second query automatically through VBA or some other code ... ?
    Thanks in Advance for you kind help.

    Hello,
    Both are possible.
    1) Please go through the following links:
    due date minus current date
    http://forums.sdn.sap.com/search.jspa?q=date%20bucket&objID=c4&dateRange=all&searchID=72203772&rankBy=10001&start=30
    2) Id directly can not import into the query. but you can display at the end of the query(Left,right,Top,Bottom). You have to use simple excel formula : =+sheet1!A1. It will display all values from sheet1 starting from cell A1 in sheet2 .
    Thanks.
    Please let me know if you need further help.
    Thanks.
    With regards,
    Anand Kumar

  • Group By Calculated Columns Issue

    Dear All,
    I have some lists and libraries which has some calculated columns for calculating year and month based on created date and we have custom views which has group by on those calculated columns. The problem is group by is not working as expected. Attached are
    the screens for reference. We have also applied the June CU still no luck.
    Please help us on the resolution to the same.
    Rajani.J

    Make sure you dont have space in the data by any chance. You can try recreating the view again.
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

  • MDX Query to Calculated member

    Hi All,
    I have a MDX query which works fine, when converting the query to Calculated member, I get the same result for all the rows of a dimension.
    select {[Measures].[Contents]} on 0,
    ([Dim Products].[Product Alias].[Product Alias].members,
    (filter ([Dim Products].[Product ID].members,
    instr(left([Dim Productss].[Product ID].currentmember.member_Key,3),'112')>0))) on 1
    from
    <<CubeName>>
    Calculated Member:
    SUM(filter ([Dim Products].[Product ID].members,
    instr(left([Dim Products].[Product ID].currentmember.member_Key,3),'112')>0),[Measures].[Contents])
    When I drag the dimension product, the calculated member showing the same result for all the products. Can anyone let me know the syntax error here.

    Hi SQL GUN,
    For me it works :
    WITH MEMBER [Last3MonthsInternetSales] AS 
    AGGREGATE
    LastPeriods(-3, ClosingPeriod([Date].[Calendar].[Month], [Date].[Calendar].[Month].&[2005]&[12])), 
    [Measures].[Internet Sales Amount]
    SET MySet AS
    {[Date].[Calendar].[Month].&[2005]&[09],
    [Date].[Calendar].[Month].&[2005]&[10],
    [Date].[Calendar].[Month].&[2005]&[11],
    [Date].[Calendar].[Month].&[2005]&[12],
    [Date].[Calendar].[Month].&[2006]&[01],
    [Date].[Calendar].[Month].&[2006]&[02]}
    SELECT
    [Measures].[Internet Sales Amount],
    [Last3MonthsInternetSales]
    } ON COLUMNS,
    MySet
    } ON ROWS
    FROM [Adventure Works]
    Are u sure your query is correct. I think you might have a [Fiscal Month Num of Year] too much in your (). I'm not sure, but are u dragging the correct level of hierarchy ? Also in the part ON ROWS you seem to take a lot of levels with you.
    Why for example take .allmembers when you only want the actual last 3 of your currentmember?
    Can u check again?

  • Indexing running forever with calculated columns

    I want to use an InfoCube as a source in Business Objects Explorer. So I defined a universe on top of the InfoCube using Information design tool along some calculated columns (similar to calculated key figures in BEx query).
    The indexing used to work fine with the default keyfigures in the InfoCube. I started using the newly created calculated columns and now the indexing runs for hours and does not complete until I remove the calculated columns. Is this a performance issue, if yes please do let me know how to fix it.
    Thank you

    Hi Pavan,
    Thanks for the reply. I will try doing that and will get back to yo.
    The relational data foundation of this universe was defined over an InfoCube and it did not have any primary keys for dimension tables (master and text) nor the foreign keys (fact table). Does this also affect the performance of explorer?

  • Writing an sql script to query a calculation view  and an attribute view inside a calculation view

    Hi,
    I was trying to query a calculation view with sql , and as one of the input parameters i was trying to give a query over an attribute view
    So my sql will look like this
    SELECT * FROM "MyApp.calculation_views::GET_CHECKLIST_FOR_ACCOUNT"('PLACEHOLDER' = ('$$ACCOUNT_ID$$', '1','$$CHECKLIST_ID$$',' SELECT CHECKLIST_ID FROM "MyApp"."CHECKLIST_PRODUCTS" WHERE PRODUCT_ID = 5'));
    So as an input to $$CHECKLIST_ID$$   i wanted to give an id selected from checklist products table where products id is passed as an input
    but this is not working, i am getting syntax error at the $$CHECKLIST_ID$$ there i can only pass values like  $$CHECKLIST_ID$$, '1'
    Please help me to figure out which  is the correct syntax  i tried putting the sql statement to get the checklist_id in '' but it too didnot work

    I'm not sure you'll be able to do a SELECT subquery directly in the placeholder definition, but you can create another calc view (scripted) as a wrapper to your original calc view and use a scalar variable to pass the parameter over.
    Try this as the base code for your second calc view:
    var_id VARCHAR(10);
    BEGIN
         SELECT CHECKLIST_ID INTO :var_id FROM "MyApp"."CHECKLIST_PRODUCTS" WHERE PRODUCT_ID = 5;
         var_out = SELECT * FROM "MyApp.calculation_views::GET_CHECKLIST_FOR_ACCOUNT"
              (PLACEHOLDER."$$ACOUNT_ID" => 1, PLACEHOLDER."$$CHECKLIST_ID$$" => :var_id);
    END
    You could even create input parameters in the second Calc View for the Account Id & Product Id (which are currently hard coded in your code below).
    Best,
    Henrique.
    PS: avoid using SELECT * for the var_out in the scripted calc view. It's better, from a code maintenance perspective, to explicitly define the columns you're outputting.

  • Calculated Column in Content Search Webpart

    I have a calculated column that I need displayed as a property in a CSWP, What I have done so far is to map  the crawled calculated column to a Managed property and selected the following:
    Query, Search Retrieve and Safe
    While I can select the managed property in the CSWP, there is nothing showing up for that field. The formula I have has HTML in it, not sure if this is causing any issues:
    ="<DIV style='display: inline; font-weight: bold; font-size: 12px; color:"&CHOOSE(RIGHT(LEFT([Plant Status],2),1),"green","red")&";'>"&[Plant Status]&"</DIV>"
    Thank you
    ITGirl

    I have a calculated column that I need displayed as a property in a CSWP, What I have done so far is to map  the crawled calculated column to a Managed property and selected the following:
    Query, Search Retrieve and Safe
    While I can select the managed property in the CSWP, there is nothing showing up for that field. The formula I have has HTML in it, not sure if this is causing any issues:
    ="<DIV style='display: inline; font-weight: bold; font-size: 12px; color:"&CHOOSE(RIGHT(LEFT([Plant Status],2),1),"green","red")&";'>"&[Plant Status]&"</DIV>"
    Thank you
    ITGirl

  • Column having minimum value of two calculated columns

    Hi All
    Please help me out in the following scenario.
    I have to get the data from two tables so whatever columns I need put it in the select statement but for two columns I have to do calculations and did assigned an alias name to those two calculated columns, lets say X & Y.
    I have to show the data for column Z, the rule for this column is to take minimum value of columns X & Y.
    I have to use purely a select statement and retrieve the data. Camnt do any changes or creating functions on database.
    thnaks in advance.

    @Sven
    First thought is using minimum function and throwed me error and then realized that min function can be used on a column and then searched for function to find minimum of calculated columns, could n't find out.
    Then thought of using case or if statement to find out the minimum, felt thats not a good idea and also thought of using nested sub query, could n't achieve the desired.
    Actually I didnt know about the least function, now I
    Anyway thnak you all.

Maybe you are looking for