Creating custom Column in IDT 4.1

Hi All,
I am using SAP IDT 4.1 SP03 to build a business layer over a SQL Server database using relational connection.
I having a single table named CUSTOMER and it contains Customer ID, Customer Name,  City, SubscribeForEmail and date column. I want to filter the data on specific date range to view the data on below format:
City
Total Customers
Customers subscribed for email only
I have created the measure in business layer and filter customer count based on subscribeforemail flag. But IDT is showing invalid data. For ex:
Database Table:
Customer ID
Customer Name
City
SubscribeForEmail
Date
1
Customer 1
City1
Y
1/1/2014
2
Customer 2
City2
Y
1/1/2014
3
Customer 3
City1
Y
1/1/2014
4
Customer 4
City1
N
1/1/20014
Data returned By IDT:
City
Total Customers
Email Only
City1
2
2
Kindly guide.

Hi Sreenivasulu,
I have created two measures in business layer based on below format:
Measure1: Total Customers = Count(DISTINCT Customer_ID)
Measure2:  Email Customers = Count(DISTINCT Customer_ID)
                                                   Where SubscribeForEmail = 'Y'
The query generated is:
SELECT
     Table_3."City",
     count( Distinct (Table_3."Customer_ID")),
     count( Distinct ( Table_3."Customer_ID"))
FROM "Customer" Table_3
WHERE
(Table_3."SubscribeForEmail" = 'Y')
GROUP BY 1
ORDER BY 1
Here, the issue is WHERE clause is applied on BOTH columns whereas I want to apply it on one only.
Regards,
Hasan Arif Khan.

Similar Messages

  • Create custom column in power query

    Hello All,
    I have a requirement to create report for the Analysis, my raw data looks like below which I'm extracting from multiple tables. I would like to extract project wise number count  based on status, my idea is to create custom columns to write the value
    if the value matches to the condition else blank. Example my status has multiple status value ( closed, on-hold,warranty,inprogress,etc) i need to know what formula will help me extract data in different columns so that i can get the count in pivot for each
    status)
    NUMBER         CATEGORY                                Internal SLA  
        EXTERNALSLA      DATE_ENTERED    STATUS
    C1000001    HEINEKEN                                    t             
                     t                  9/13/2014            CLOSED
    C1000002    Migration-BLACKROCK AppV                                                           
    2/11/2015    Terminated
    C1000004    Migration-BLACKROCK AppV                                                          
    10/24/2014    CLOSED
    C1000005    Migration-BLACKROCK AppV        t                                  t  
                  1/12/2015    On-Hold
    C1000006    Migration-BLACKROCK AppV                                                  
             11/5/2014    CLOSED
    C1000007    Migration-BLACKROCK AppV    t                                       
    t               9/12/2014    CLOSED
    C1000008    Migration-BLACKROCK AppV                                                              
    8/6/2014    On-Hold
    C1000009    BLACKROCK                                                                                      
    8/5/2014    In Progress
    C1000010    Migration-BLACKROCK AppV    t                                          t  
                  8/5/2014    On-Hold
    C1000011    Migration-BLACKROCK AppV                                                              
    10/25/2014    CLOSED
    C1000012    BLACKROCK                                                                                        
    9/24/2014    CLOSED
    C1000013    BLACKROCK                                                                                      
    10/16/2014    Terminated
    C1000015    BLACKROCK                                                                                        
    9/1/2014    In Progress

    Hi Imke,
    I have achieved what i wanted to... I did try the way you have suggested. But end result was not fruitful.
    I did following for status wise count.
    Step1: In power query I have created duplicate status column for each status available.( Example I have status {closed,open,initial... etc} I have created duplicate column for each status and replaced with null.For closed Except closed all i replaced in
    column with null).
    Step2: So every time my power query data refreshes it does that step each time so that i can get the count of each status column wise in my pivot table.
    I have attached the result,
    Harsha

  • How to create custom cloumns in report

    Hi,
    I want to create custom columns in the reports(columns which are not present in active subject area. Please help.
    Thanks
    Arpita

    Arpita,
    You can create a calculated column using any Field (Presentation Column) in any Presentaion Table.
    Eg: You want to calculate the difference between the Start and End Date of an Activity.
    1. Simply Create a report on the Activities SA (Analytics or Real-time doe not matter here)
    2. Add the required Coumns
    3. To calculate the difference between the Start and End time.
    - add the below fields from Activity
    - Click the 'Fx' icon any field that you would like to display the calculated value in.
    - Replace the existing formula in this field with TIMESTAMPDIFF(SQL_TSI_DAY, Activity."Created Date", Activity."Completed Date") - This is your calculated value
    Activity ID     Subject     Created Date     Completed Date     Difference
    AXXX-IHJ1W     Prepare Proposal     10/31/2011 6:39:43 AM     11/18/2011 4:48:54 AM     18
    For more details, I would suggest you look at the CRM On Demand Bookshelf or click the hlp link in CRM On Demand.
    Hope this helps!
    Thanks,
    Royston

  • When i attach workflow to document library, the custom columns data is not saving.

    Hi, i had created SharePoint designer workflow (send Email) for Document Library.
    I had created Custom columns like.
    "Employee Name" of type Person or Group  
    "Resume Type"  of type Choice 
    When i attach my workflow to document library, the columns data is not saved.
    It is just uploading resume, and sends email to the user groups, but data is not saved for custom columns. !.e "Employee Name" and "Resume Type".
    Any help will be appreciated.

    In SharePoint Document Library, first the document will be uploaded and then the metadata will be updated. So, in your workflow settings, select start workflow when item is changed instead of item is created and then try. 

  • How to pass custom column value that is created in Answers to its detail report

    Hi,
        I have a custom column (in the below ex: 'Aging') which is calculated based on prompt date and arrived at the below aging buckets. I have a drill report from 'Balance' column. When I click on 100/200/125 corresponding 'Aging' value should be passed to the detail report.
    Aging
    Balance
    0-30 days
    100
    31-60 days
    200
    61-90 days
    125
    Tried putting the 'Aging' formula in detail report and make it 'is prompted' - no luck.
    Is creating the logic in RPD with a request variable (to pass prompt date) only option to  solve this? Any suggestions?
    Thanks in advance and a very happy new year.

    Finally, we used a request variable and handled this in RPD.

  • Creating Custom Theme for Power View Clustered columns chart

    Helllo...
    Is it possible to create custom theme for displaying clustered columns chart on Power View?
    Basically I am looking to create chart with specific colors for the bars? For e.g. for High - RED, Medium - Orange and Low - Yellow color. When I look at themes available in Excel 2013 I don't see this combination as such, so I was looking to create one
    myself. 
    I tried to create a theme using video on youtube, but the theme which I created is not showing up in Power View mode in excel 2013.
    www.youtube.com/watch?v=xs2F1n2-YR8

    Hi Sagar,
    In Power View, it has several default theme colors for us to apply to our workbook. Also, we can change the Font, Text Size and Background of the chart. However, it is not support to design a custom theme color.
    You can refer to the following steps to change the theme colors:
    1. On the POWER VIEW tab, in the Themes group, click Themes.
    2. Under Built-in, click the theme that you want to use.
    Please refer to the following screenshot below:
    Regards,
    Alisa Tang
    If you have any feedback on our support, please click
    here.
    Alisa Tang
    TechNet Community Support

  • How to Create Custom Content Type with 100 site columns ?

    Hi EveryOne,
    i have one requirement to create custom conten types in sharepoint 2013 as follows.
    1. Create a content type with 100 site columns ( in this 100 site columns includes 10 mms feilds and 10 lookup fields).
    2.when we deploy the content type in other server if already the same content type existing in the server it should be upgrade the existing content type.
    Please advise how do develop the solution ( using power shell script or visual studio with event receiver or xml file)
    Regards,
    Srinivas

    Try below:
    http://www.mindfiresolutions.com/Add-Columns--Fields-Programmatically-to-a-SharePoint-List-282.php
    using(SPSite
    oSPsite = new SPSite("http://Web-URL"))
        oSPsite.AllowUnsafeUpdates =
    true;
    using (SPWeb oSPWeb = oSPsite.OpenWeb())
            oSPWeb.AllowUnsafeUpdates =
    true;
    /* get the SPList object by list name*/
    SPList lst = oSPWeb.Lists["EmpList"];
    /* create a Numeric field for EmpID */
    SPFieldNumber fldEmpID = (SPFieldNumber)lst.Fields.CreateNewField(
    SPFieldType.Number.ToString(),
    "EmpID");
            fldEmpID.Required =
    true;
            fldEmpID.DisplayFormat =
    SPNumberFormatTypes.NoDecimal;
    /* create a Text field for Name */
            SPFieldText fldName = (SPFieldText)lst.Fields.CreateNewField(
    SPFieldType.Text.ToString(),
    "Name");
            fldName.Required =
    true;
            fldName.MaxLength = 50;
    /* create a Date field for Dob*/
    SPFieldDateTime fldDob = (SPFieldDateTime)lst.Fields.CreateNewField(
    SPFieldType.DateTime.ToString(),
    "Dob");
            fldDob.DisplayFormat =
    SPDateTimeFieldFormatType.DateOnly;
    /* create a Currency field for Salary */
            SPFieldCurrency fldSal = (SPFieldCurrency)lst.Fields.CreateNewField(
    SPFieldType.Currency.ToString(),
    "Salary");
            fldSal.Currency =
    SPCurrencyFieldFormats.UnitedStates;
            fldSal.DisplayFormat =
    SPNumberFormatTypes.TwoDecimals;
    /* add the new fields to the list */
            lst.Fields.Add(fldEmpID);
            lst.Fields.Add(fldName);
            lst.Fields.Add(fldDob);
            lst.Fields.Add(fldSal);
    /* finally update list */
            lst.Update();
            oSPWeb.AllowUnsafeUpdates =
    false;
        oSPsite.AllowUnsafeUpdates =
    false;
    If this helped you resolve your issue, please mark it Answered

  • F-53 and F-28, Customized columns for cash discount and %

    Hi Expert,
    With reference to the subject of: Customized columns for cash discount and % ...
    I faced the problem of not able to set / defined hidden column for cash discount and % by creating a new variant.
    Steps:
    Create a variant
    Click <administrator> button ... mark the columns hidden, and click <activate> button
    Then click <Save> button
    Problem: Every time I using the F-53/F-28, the layout is not working, and when goto check the variant settings, the cash discount and % columns remained unchecked.
    SAP version: 4.6
    Kindly advise.
    Thanks and regards,
    sbmel

    Hi JP,
    It is not working using field status group, as I am using F-53 and F-28 and not FB50/60/70.
    The purpose I want to create variant for screen after clicking <process open item> is to control column display (hide cash discount and %).  if the variant is working, I can create a customized Tcode for the F-53 and F-28.
    Now problem is that variant seem not working.
    Thanks and regards,
    sbmel

  • Is there an easy view of assigned Retention Tags in main view of Messages, e.g. a custom column?

    Hi,
    I have a requiement to have an easy/overall view of assigned Retention Policy tags against a list of messages in outlook 2010.
    I envisage that if there was a column in the main message list view, that showed the assigned tag against each message and that could be sorted, e.g. so I can see what has an assigned tag (and what it is) and what doesn't, this would hit the mark perfectly.
    Any such capability?
    Can I create a custom column that extracts a message property to do this?
    If so, how?
    Thanks! David.

    Hi Greg,
    Sorry it's been a couple of days, it's been busy.
    Unfortunately not. I raised it with our devs to take a look at. I was initially after an assessment of effort. But they were quoting me a number of days effort just to get to the point of being able to tell me how long it would take. At that point I
    pulled it, as it wasn't a must-have requirement.
    Still, it would have been nice.
    To extract such a property, I might imagine an Outlook plug-in to extract the data from the property and watchers to look out for changes in various circumstances. In this way if you can get the data into a new Custom Message Property, a Column
    will readily display it. It feels a little over-engineered and duplicates the data just to get it into a place to show it.
    Maybe there are easier ways. But no, I didn't make progress.
    All the best. Ta, /David.

  • Custom column added is not available for Calendar list view in SharePoint 2010

    I created a custome column "Breakline" in a custom content type 'SM event", and applied the content type to a Calendar.
    The column is listed under the content type "SM event" but it is not listed when I tried to modify the view using the "Breakline" column.
    Does anyone know why?

    I set "Breakline" hidden because I don't want to show this in create new item form. 
    I realized that may be the reason. So changed the column to Optional in CT and created a new calendar using that CT. then at list level CT I changed it to Hidden.  That works.   The column is available for use when modifying view.
    Thanks

  • Custom column in a list view web part for a multilingual site does not take on custom language labels. Stays in default language.

    Hello all,
    I have what so far appears to be a fairly unique problem.  We are running a multilingual SharePoint 2010 environment with English as the default language and French as the secondary.  We have setup the sites in a variance relationship, but the
    issue I am discussing happens outside of a variant as well.
    We have created a library outside the variant (but within the collection) that the two sites must share.  A list view web part was created via Designer to add to each site to provide a quick view into the list.  If we are in the libary and switch
    to French, then update the column label it will remember the setting (because of the resource file) and maintain it as the language is flipped back and forth.  Where it doesn't work is as a web part in a variant or where the language is different.
    If the language is different, the out of the box columns work find, but the custom columns (all site columns not library\list columns) remain as the english label.  It doesn't matter if within a variant or outside with the browser language changed. 
    It always reverts back to English.  It's like it isn't using the same resource file that was used in the list itself.
    I created a custom view and modified it with xslt as per
    http://sharepoint.stackexchange.com/questions/50004/how-to-change-column-title-for-a-view-but-not-modify-the-list but this only worked within the list and did not occur in the list view either.
    I can't be the first that has come across it, either I am not performing my searches properly, no one has ever documented a fix for this or this is something we just can't fix with OOTB tools.  That's the other thing, the solution has to be accomplised
    OOTB or with minor client side changes.  I can't fire up Visual Studio because they are piloting Office 365 and have put a "No custom code" mandate on for migration.
    Thank you all in advance.

    Ok, I have come up with a solution.  I edited the XSLT for the web part on the page.  I did the following:
    1.    Create the variants in the Site Ccollection
    2.    Create the library outside of the variants.
    3.    Add all the columns you require for the library.  It is very important all the columns are there before you move on.
    4.    Create a French and English view.
    5.    Create the list view web part via designer.
    6.    Add the list view web part to each site selecting the appropriate view to use.
    7.      Edit the page in SharePoint Designer 2010.
    8.      Place cursor in the column you wish to modify.
    9.      Click Design in the List View Tools on the ribbon.  
    10.     Then click Customize XSLT and select Customize Item.  Select this option otherwise you will generate a **LOT** of unnecessary XSL code.
    11.     You are looking for a piece that resembles the following:
            <xsl:with-param name="fieldtitle">
              <xsl:value-of select="@DisplayName"/>
            </xsl:with-param>
    12.      Modify it by typing in the actual column name you want.  You should end up with something like this:
            <xsl:with-param name="fieldtitle">
              New Column Name.
            </xsl:with-param>
    13.      Now, for this page only, the column will be renamed.
    There are some caveats:
    1.    Doesn’t appear to work in a publishing portal.  I think this has to do with how SP stores the pages in this case.  In a publishing portal you can only modify the page layout which won’t work as we need to modify the content.
    2.    If you add another column, you will need to repeat the XSLT modification
    Anyways, I hope this helps out any others with the same issue or need as I had.

  • Custom column in List view

    Dear guru's,
    I'd like to ask you if its possible to add custom column in list view. For example in tc. FBL1N I'd like to add a column with custom text (for example with value "1" for counting the sum of rows). Is it possible to do without creating custom program?
    Thank you all.
    Regards.
    Michael.

    Hi Michael,
    It's not possible to add some extra text in standard out-put without modifying it or creating custom program.
    For adding a column in your list view. I think this write statement will help you
    WRITE 'You can overwrite the following line:'.
    FORMAT INPUT ON INTENSIFIED OFF.
    WRITE 'WRITE HERE'.
    FORMAT INPUT OFF INTENSIFIED ON.

  • Import From Folder: How to Extract the File Name in a Custom Column.

    Hello All
    Here´s what we´re trying to do:
    We have a folder with csv files named like this:
    Sales_2013-02-05.csv
    Sales_2013-02-04.csv
    Sales_2013-02-03.csv
    Sales_2013-02-02.csv
    Sales_2013-02-01.csv
    And in the csv files there are the sales columns but not the date column.
    So we want to extract the date from the file name.
    I´ve tried entering = Source[Name] in a custom column, but it adds a "LIST" link, and on a click on expand, it adds ALL file names from the folder in each row, instead of just the needed one.
    If we could get the proper file name in each row (from where they got extracted), we could split the column and get the date from there. But I don´t know how put the filename there properly.
    Can you help?

    This isn't entirely straightforward, but it's definitely possible. What you need to do is to apply all of your transforms to each individual file instead of the combined files. I do that as follows:
    1) Use Folder.Files as generated by the GUI to look at the list of my files.
    2) Pick one file and do all the transformations to it that I want to apply to all of the files. Sometimes, this just amounts to letting the autodetection figure out the column names and types.
    3) Go into the advanced editor and edit my code so that the transformations from step 2 are applied to all files. This involves creating a new function and then applying that function to the content in each row.
    4) Expand the tables created in step 3.
    As an example, I have some files with names that match the ones you suggested. After steps 1 + 2, my query looks like the following:
    let
        Source = Folder.Files("d:\testdata\files"),
        #"d:\testdata\files\_Sales_2013-02-01 csv" = Source{[#"Folder Path"="d:\testdata\files\",Name="Sales_2013-02-01.csv"]}[Content],
        #"Imported CSV" = Csv.Document(#"d:\testdata\files\_Sales_2013-02-01 csv",null,",",null,1252),
        #"First Row as Header" = Table.PromoteHeaders(#"Imported CSV"),
        #"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"One", Int64.Type}, {"Two", type text}, {"Three", type text}})
    in
        #"Changed Type"
    For step 3, I need to take steps 3-5 of my query and convert them into a function. As a check, I can apply that function to the same file that I chose in step 2. The result looks like this:
    let
        Source = Folder.Files("d:\testdata\files"),
        Loader = (file) =>
            let
                #"Imported CSV" = Csv.Document(file,null,",",null,1252),
                #"First Row as Header" = Table.PromoteHeaders(#"Imported CSV"),
                #"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"One", Int64.Type}, {"Two", type text}, {"Three", type text}})
            in
                #"Changed Type",
        #"d:\testdata\files\_Sales_2013-02-01 csv" = Source{[#"Folder Path"="d:\testdata\files\",Name="Sales_2013-02-01.csv"]}[Content],
        Loaded = Loader(#"d:\testdata\files\_Sales_2013-02-01 csv")
    in
        Loaded
    Now I apply the same function to all of the rows, transforming the existing "Content" column into a new value:
    let
        Source = Folder.Files("d:\testdata\files"),
        Loader = (file) =>
            let
                #"Imported CSV" = Csv.Document(file,null,",",null,1252),
                #"First Row as Header" = Table.PromoteHeaders(#"Imported CSV"),
                #"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"One", Int64.Type}, {"Two", type text}, {"Three", type text}})
            in
                #"Changed Type",
        Transformed = Table.TransformColumns(Source, {"Content", Loader})
    in
        Transformed
    Finally, I need to expand out the columns in the table, which I can do by clicking on the expand icon next to the Content column header. The resulting query looks like this:
    let
        Source = Folder.Files("d:\testdata\files"),
        Loader = (file) =>
            let
                #"Imported CSV" = Csv.Document(file,null,",",null,1252),
                #"First Row as Header" = Table.PromoteHeaders(#"Imported CSV"),
                #"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"One", Int64.Type}, {"Two", type text}, {"Three", type text}})
            in
                #"Changed Type",
        Transformed = Table.TransformColumns(Source, {"Content", Loader}),
        #"Expand Content" = Table.ExpandTableColumn(Transformed, "Content", {"One", "Two", "Three"}, {"Content.One", "Content.Two", "Content.Three"})
    in
        #"Expand Content"
    From here, you should be able to get to what you want.

  • How to set a custom column in a workflow task.

    Hello,
    I'm looking for some assistance a bit with how to set a custom column in a Workflow Task.
    I have a List Workflow that starts when an item is created in a list. The workflow, platform type SharePoint 2013, starts a new task, Task1, with Content Type 1. This Content Type has a custom column called Age. Once the Task1 is completed a new task, Task2,
    with Content Type 2, starts and has the same column Age, as Task1.
    How can I populate the Age column in Task2 with the content of the Age column in Task1?
    Since I start the task by running "Assign a task to ..." Action I was thinking to copy the Age column from the Task1 to the list item that started Task1, which has a column Age as well, and then in Task2 to start another workflow - which is associated
    with the Content Type 2,  that would try to read the Age column from the list item that started Task2, which was set once Task1 was competed - I know it's complex but this is how I was thinking. 
    The problem with this approach is that I can't get a reference to the list item that started Task2 to read the Age from the list item.
    Is there a better approach? I use SharePoint Designer 2013 to design all this.
    Any assistance is appreciated.
    Thank you.

    Hello Sebastian,
    you can get the Age column from Task 1 and then update the Task 2 Age column with that value. I am not sure why you want to run another workflow on Task 2.
    You can perform below steps to set Age column from Task 1 to Task 2.
    1.  Create Task 1 using Assign a task , wait till the task is completed.
    2. Get the Age column value based on Task 1 once the task is completed.
    3.Create Task 2 using Assign a task ,  uncheck wait till the task is completed option.
    4. Update the Task 2 with Age column in Task1.
    5. Use Wait for the field to equal value , check for Task Status is completed or not.
    >>The problem with this approach is that I can't get a reference to the list item that started Task2 to read the Age from the list item.
    you can get the related item from task list item to get the main list item.
    Other option is, Use Javascript and CSOM  in task edit form to get the Age column from Task1 and prepoluate the Age value when Task2 is opened.
    Hope this helps.
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • SharePoint 2013 Make Calculated Column based on Custom Column

    In SharePoint 2013, I am trying to create a Calculated Column that is a shortened display of another Custom Column. The Calculated Column would just show the first 100 characters concatenated with "..." like in the following formula:
    =LEFT([CustomColumn],100)&"..."
    However, every time that I go to create this calculated column, SharePoint doesn't provide my [CustomColumn] in the "Insert Column:" list. If I type it in anyway, SharePoint throws an error.
    Details on my Column, List, and Site below:
        Col. Type: Multiple lines of text
        Col. Group: Custom Columns
        Col. Text Type: Enhanced rich text
        List Content Type: Custom Type Inherits from Event
        Site Type: Publishing
    Also, to no avail, I found this similar post (link below), but creating the Site Column and Calculated Column
    before adding it to the Content Type did not work for me. 
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/26a7517e-ba43-4c49-95aa-3e6f7f4207ba/calculated-field-in-content-type-not-working
    Anyone out there know how to coax SharePoint into submission?!

    Multi lines of text are one of the types of columns which can't be used by calculated columns/fields. Among such unusable columns are also Lookup columns, People columns, External Columns, MMS columns, etc.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

Maybe you are looking for

  • How to track my Mac Book Pro

    HOw do I track a stolen Mac Book Pro

  • Linking to Shared Drive in InDesign

    I know how to create Hyperlinks in InDesign, but what if I want the user/reader to be able to click on a Shared Drive link that will take them directly to a particular shared drive folder on a company's shared drive? Is this possible? It's not an "ht

  • Photo album command does not launch fireworks

    When i click the create phto web album it starts to launch the dialogue box to create but then flips to the fact that I need to download fireworks. But I already have firework! Dreamweaver is MX and forewprks is CS3 - ANY IDEAS?

  • ADFS server in NLB cluster unable to reach all servers in the same subnet

    I have 2 ADFS (3.0) virtual servers (server 2012 R2 on VMware) in an NLB cluster (setup for Office 365 initially) and want to be able to use the SAML to connect to a couple of Linux servers in the same network to allow SSO to the Linux boxes. It was

  • Don't want Reader to be default viewer

    I just had to download the new version of Reader for one particular website and pdf file. Now it is always used by Safari even though Preview is the default setting. I want it to STOP! How do I get Safari to stop using Reader? I have a Macbook Pro an