Remove Last part

i have this data
ELECT  [item_id]  ,[f2] from [Regions]
1. ُEgypt
1.1. Cairo
1.1.21. New Cairo
i want to remove last part 
like in Egypt remove 1.
and on Cairo remove  last 1.
and on New Cairo last 21.

Try:
DECLARE @City TABLE ( CityName varchar(100));
INSERT @City VALUES
('1. Egypt'),
('1.1. Cairo'),
('1.1.21. New Cairo'),
('1.1.21.5. Alexandria')
-- SELECT STUFF('abcdef', 2, 3, 'ijklmn');
SELECT
CityName, RenumberedCityName=
LTRIM(STUFF(REVERSE(SUBSTRING(SUBSTRING(REVERSE(CityName), CHARINDEX('.', REVERSE(CityName),1)+1,LEN(CityName))+'.',
CHARINDEX('.',SUBSTRING(REVERSE(CityName), CHARINDEX('.', REVERSE(CityName),1)+1,LEN(CityName))+'.'),len(CityName))),1,1,'')+SPACE(1)+
REVERSE(LTRIM(RTRIM(LEFT (REVERSE(CityName), CHARINDEX('.', REVERSE(CityName),1)-1)))))
FROM @City WHERE CHARINDEX('.',CityName) > 0;
CityName RenumberedCityName
1. Egypt Egypt
1.1. Cairo 1. Cairo
1.1.21. New Cairo 1.1. New Cairo
1.1.21.5. Alexandria 1.1.21. Alexandria
-- USING hierarchyid method
SELECT
CityName, RenumberedCityName=
LTRIM(REPLACE(STUFF(CONVERT(hierarchyid,'/'+REPLACE(LEFT(CityName, CHARINDEX(' ', CityName)-1),'.','/')).GetAncestor(1).ToString(),1,1,''),'/','.')
+SPACE(1)+REVERSE(LTRIM(RTRIM(LEFT (REVERSE(CityName), CHARINDEX('.', REVERSE(CityName),1)-1)))))
FROM @City WHERE CHARINDEX('.',CityName) > 0;
CityName RenumberedCityName
1. Egypt Egypt
1.1. Cairo 1. Cairo
1.1.21. New Cairo 1.1. New Cairo
1.1.21.5. Alexandria 1.1.21. Alexandria
Kalman Toth Database & OLAP Architect
SQL Server 2014 Design & Programming
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Similar Messages

  • Introduction to regular expressions ... last part.

    Continued from Introduction to regular expressions ... continued., here's the third and final part of my introduction to regular expressions. As always, if you find mistakes or have examples that you think could be solved through regular expressions, please post them.
    Having fun with regular expressions - Part 3
    In some cases, I may have to search for different values in the same column. If the searched values are fixed, I can use the logical OR operator or the IN clause, like in this example (using my brute force data generator from part 2):
    SELECT data
      FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
    WHERE data IN ('abc', 'xyz', '012');There are of course some workarounds as presented in this asktom thread but for a quick solution, there's of course an alternative approach available. Remember the "|" pipe symbol as OR operator inside regular expressions? Take a look at this:
    SELECT data
      FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
    WHERE REGEXP_LIKE(data, '^(abc|xyz|012)$')
    ;I can even use strings composed of values like 'abc, xyz ,  012' by simply using another regular expression to replace "," and spaces with the "|" pipe symbol. After reading part 1 and 2 that shouldn't be too hard, right? Here's my "thinking in regular expression": Replace every "," and 0 or more leading/trailing spaces.
    Ready to try your own solution?
    Does it look like this?
    SELECT data
      FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
    WHERE REGEXP_LIKE(data, '^(' || REGEXP_REPLACE('abc, xyz ,  012', ' *, *', '|') || ')$')
    ;If I wouldn't use the "^" and "$" metacharacter, this SELECT would search for any occurence inside the data column, which could be useful if I wanted to combine LIKE and IN clause. Take a look at this example where I'm looking for 'abc%', 'xyz%' or '012%' and adding a case insensitive match parameter to it:
    SELECT data
      FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
    WHERE REGEXP_LIKE(data, '^(abc|xyz|012)', 'i')
    ; An equivalent non regular expression solution would have to look like this, not mentioning other options with adding an extra "," and using the INSTR function:
    SELECT data
      FROM (SELECT data, LOWER(DATA) search
              FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
    WHERE search LIKE 'abc%'
        OR search LIKE 'xyz%'
        OR search LIKE '012%'
    SELECT data
      FROM (SELECT data, SUBSTR(LOWER(DATA), 1, 3) search
              FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
    WHERE search IN ('abc', 'xyz', '012')
    ;  I'll leave it to your imagination how a complete non regular example with 'abc, xyz ,  012' as search condition would look like.
    As mentioned in the first part, regular expressions are not very good at formatting, except for some selected examples, such as phone numbers, which in my demonstration, have different formats. Using regular expressions, I can change them to a uniform representation:
    WITH t AS (SELECT '123-4567' phone
                 FROM dual
                UNION
               SELECT '01 345678'
                 FROM dual
                UNION
               SELECT '7 87 8787'
                 FROM dual
    SELECT t.phone, REGEXP_REPLACE(REGEXP_REPLACE(phone, '[^0-9]'), '(.{3})(.*)', '(\1)-\2')
      FROM t
    ;First, all non digit characters are beeing filtered, afterwards the remaining string is put into a "(xxx)-xxxx" format, but not cutting off any phone numbers that have more than 7 digits. Using such a conversion could also be used to check the validity of entered data, and updating the value with a uniform format afterwards.
    Thinking about it, why not use regular expressions to check other values about their formats? How about an IP4 address? I'll do this step by step, using 127.0.0.1 as the final test case.
    First I want to make sure, that each of the 4 parts of an IP address remains in the range between 0-255. Regular expressions are good at string matching but they don't allow any numeric comparisons. What valid strings do I have to take into consideration?
    Single digit values: 0-9
    Double digit values: 00-99
    Triple digit values: 000-199, 200-255 (this one will be the trickiest part)
    So far, I will have to use the "|" pipe operator to match all of the allowed combinations. I'll use my brute force generator to check if my solution works for a single value:
    SELECT data
      FROM TABLE(regex_utils.gen_data('0123456789', 3))
    WHERE REGEXP_LIKE(data, '^(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})$') 
    ; More than 255 records? Leading zeros are allowed, but checking on all the records, there's no value above 255. First step accomplished. The second part is to make sure, that there are 4 such values, delimited by a "." dot. So I have to check for 0-255 plus a dot 3 times and then check for another 0-255 value. Doesn't sound to complicated, does it?
    Using first my brute force generator, I'll check if I've missed any possible combination:
    SELECT data
      FROM TABLE(regex_utils.gen_data('03.', 15))
    WHERE REGEXP_LIKE(data,
                       '^((25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})$'
    ;  Looks good to me. Let's check on some sample data:
    WITH t AS (SELECT '127.0.0.1' ip
                 FROM dual
                UNION 
               SELECT '256.128.64.32'
                 FROM dual            
    SELECT t.ip
      FROM t WHERE REGEXP_LIKE(t.ip,
                       '^((25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})$'
    ;  No surprises here. I can take this example a bit further and try to format valid addresses to a uniform representation, as shown in the phone number example. My goal is to display every ip address in the "xxx.xxx.xxx.xxx" format, using leading zeros for 2 and 1 digit values.
    Regular expressions don't have any format models like for example the TO_CHAR function, so how could this be achieved? Thinking in regular expressions, I first have to find a way to make sure, that each single number is at least three digits wide. Using my example, this could look like this:
    WITH t AS (SELECT '127.0.0.1' ip
                 FROM dual
    SELECT t.ip, REGEXP_REPLACE(t.ip, '([0-9]+)(\.?)', '00\1\2')
      FROM t
    ;  Look at this: leading zeros. However, that first value "00127" doesn't look to good, does it? If you thought about using a second regular expression function to remove any excess zeros, you're absolutely right. Just take the past examples and think in regular expressions. Did you come up with something like this?
    WITH t AS (SELECT '127.0.0.1' ip
                 FROM dual
    SELECT t.ip, REGEXP_REPLACE(REGEXP_REPLACE(t.ip, '([0-9]+)(\.?)', '00\1\2'),
                                '[0-9]*([0-9]{3})(\.?)', '\1\2'
      FROM t
    ;  Think about the possibilities: Now you can sort a table with unformatted IP addresses, if that is a requirement in your application or you find other values where you can use that "trick".
    Since I'm on checking INET (internet) type of values, let's do some more, for example an e-mail address. I'll keep it simple and will only check on the
    "[email protected]", "[email protected]" and "[email protected]" format, where x represents an alphanumeric character. If you want, you can look up the corresponding RFC definition and try to build your own regular expression for that one.
    Now back to this one: At least one alphanumeric character followed by an "@" at sign which is followed by at least one alphanumeric character followed by a "." dot and exactly 3 more alphanumeric characters or 2 more characters followed by a "." dot and another 2 characters. This should be an easy one, right? Use some sample e-mail addresses and my brute force generator, you should be able to verify your solution.
    Here's mine:
    SELECT data
      FROM TABLE(regex_utils.gen_data('a1@.', 9))
    WHERE REGEXP_LIKE(data, '^[[:alnum:]]+@[[:alnum:]]+(\.[[:alnum:]]{3,4}|(\.[[:alnum:]]{2}){2})$', 'i'); Checking on valid domains, in my opinion, should be done in a second function, to keep the checks by itself simple, but that's probably a discussion about readability and taste.
    How about checking a valid URL? I can reuse some parts of the e-mail example and only have to decide what type of URLs I want, for example "http://", "https://" and "ftp://", any subdomain and a "/" after the domain. Using the case insensitive match parameter, this shouldn't take too long, and I can use this thread's URL as a test value. But take a minute to figure that one out for yourself.
    Does it look like this?
    WITH t AS (SELECT 'Introduction to regular expressions ... last part. URL
                 FROM dual
                UNION
               SELECT 'http://x/'
                 FROM dual
    SELECT t.URL
      FROM t
    WHERE REGEXP_LIKE(t.URL, '^(https*|ftp)://(.+\.)*[[:alnum:]]+(\.[[:alnum:]]{3,4}|(\.[[:alnum:]]{2}){2})/', 'i')
    Update: Improvements in 10g2
    All of you, who are using 10g2 or XE (which includes some of 10g2 features) may want to take a look at several improvements in this version. First of all, there are new, perl influenced meta characters.
    Rewriting my example from the first lesson, the WHERE clause would look like this:
    WHERE NOT REGEXP_LIKE(t.col1, '^\d+$')Or my example with searching decimal numbers:
    '^(\.\d+|\d+(\.\d*)?)$'Saves some space, doesn't it? However, this will only work in 10g2 and future releases.
    Some of those meta characters even include non matching lists, for example "\S" is equivalent to "[^ ]", so my example in the second part could be changed to:
    SELECT NVL(LENGTH(REGEXP_REPLACE('Having fun with regular expressions', '\S')), 0)
      FROM dual
      ;Other meta characters support search patterns in strings with newline characters. Just take a look at the link I've included.
    Another interesting meta character is "?" non-greedy. In 10g2, "?" not only means 0 or 1 occurrence, it means also the first occurrence. Let me illustrate with a simple example:
    SELECT REGEXP_SUBSTR('Having fun with regular expressions', '^.* +')
      FROM dual
      ;This is old style, "greedy" search pattern, returning everything until the last space.
    SELECT REGEXP_SUBSTR('Having fun with regular expressions', '^.* +?')
      FROM dual
      ;In 10g2, you'd get only "Having " because of the non-greedy search operation. Simulating that behavior in 10g1, I'd have to change the pattern to this:
    SELECT REGEXP_SUBSTR('Having fun with regular expressions', '^[^ ]+ +')
      FROM dual
      ;Another new option is the "x" match parameter. It's purpose is to ignore whitespaces in the searched string. This would prove useful in ignoring trailing/leading spaces for example. Checking on unsigned integers with leading/trailing spaces would look like this:
    SELECT REGEXP_SUBSTR(' 123 ', '^[0-9]+$', 1, 1, 'x')
      FROM dual
      ;However, I've to be careful. "x" would also allow " 1 2 3 " to qualify as valid string.
    I hope you enjoyed reading this introduction and hope you'll have some fun with using regular expressions.
    C.
    Fixed some typos ...
    Message was edited by:
    cd
    Included 10g2 features
    Message was edited by:
    cd

    Can I write this condition with only one reg expr in Oracle (regexp_substr in my example)?I meant to use only regexp_substr in select clause and without regexp_like in where clause.
    but for better understanding what I'd like to get
    next example:
    a have strings of two blocks separated by space.
    in the first block 5 symbols of [01] in the second block 3 symbols of [01].
    In the first block it is optional to meet one (!), in the second block it is optional to meet one (>).
    The idea is to find such strings with only one reg expr using regexp_substr in the select clause, so if the string does not satisfy requirments should be passed out null in the result set.
    with t as (select '10(!)010 10(>)1' num from dual union all
    select '1112(!)0 111' from dual union all --incorrect because of '2'
    select '(!)10010 011' from dual union all
    select '10010(!) 101' from dual union all
    select '10010 100(>)' from dual union all
    select '13001 110' from dual union all -- incorrect because of '3'
    select '100!01 100' from dual union all --incorrect because of ! without (!)
    select '100(!)1(!)1 101' from dual union all -- incorrect because of two occurencies of (!)
    select '1001(!)10 101' from dual union all --incorrect because of length of block1=6
    select '1001(!)10 1011' from dual union all) --incorrect because of length of block2=4
    select '10110 1(>)11(>)0' from dual union all)--incorrect because of two occurencies of (>)
    select '1001(>)1 11(!)0' from dual)--incorrect because (!) and (>) are met not in their blocks
    --end of test data

  • Importing mp3 into my itunes skips last parts of the names

    hi
    hopefully you can resolve a problem I have
    when I upload my mp3 or aac files into itunes it skips the last parts of the lines, when a song has a long name I have to retype the whole song, kind of annoying.
    is there a solution?
    i think it is a problem within itunes because the song name (the end part) is being removed only when I arrange the songs and give them a albumname or another name
    spencer

    iTunes>edit>preferences>advanced>importing tab, the box that states "retrieve CD track names from the internet" must be checked, so iTunes can connect with CDDB to look up the information for the CD you are trying to import.
    As a new poster in the forums, I need to make a suggestion. You have posted in the Mac forum when your issue should really have been posted in the Windows forum. This is probably why no one has responded to you.

  • Best way to remove last line-feed in text file

    What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
    (as echo -n will remove all trailing newline characters)

    What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
    (as echo -n will remove all trailing newline characters)
    According to my experiments, you have removed all line terminators from the file, and replaced those between lines with a space.
    That is to say, you have turned a multi-line file into one long line with no line terminator.
    If that is what you want, and your files are not very big, then your echo statement might be all you need.
    If you need to deal with larger files, you could try using the 'tr' command, and something like
    tr '
    ' ' ' <file.txt >newfile.txt
    The only problem with this is, it will most likely give you a trailing space, as the last newline is going to be converted to a space. If that is not acceptable, then something else will have to be arranged.
    However, if you really want to maintain a multi-line file, but remove just the very last line terminator, that gets a bit more complicated. This might work for you:
    perl -ne '
    chomp;
    print "
    " if $n++ != 0;
    print;
    ' file.txt >newfile.txt
    You can use cat -e to see which lines have newlines, and you should see that the last line does not have a newline, but all the others still do.
    I guess if you really did mean to remove all newline characters and replace them with a space, except for the last line, then a modification of the above perl script would do that:
    perl -ne '
    chomp;
    print " " if $n++ != 0;
    print;
    ' file.txt >newfile.txt
    Am I even close to understanding what you are asking for?

  • Can't figure out last part of a powershell script

    Hey guys,
    First time posting here. I have a powershell project for school that I'm trying to figure out. I don't have a lot of experience with powershell, but I've gotten most of my project done. I am having issues with this last part. Here is the part of the assignment
    I can't seem to get working properly:
    Process the items in the <localgroupManagement> node.
    Find all non-domain controller computers in the domain
    Add the domain global group specified in the <members><group> node(s) to each discovered computer’s local group specified by the
    <name> node.  If the local group does not exist create it.
    Here is the code I currently have:
    param([string]$filename)
    Function createOU($OU) {
        if ( !(Get-ADOrganizationalUnit -filter {name -eq $OU}) ) {
            Write-Host "Creating new OU: $OU"
            New-ADOrganizationalUnit -Name $OU -Path $ADDomainName
        else {
            Write-Host "OU already exists: $OU"
    Function addUser($account, $fn, $ln, $desc, $pwd, $OU, $ADDomainName, $ADgroup) {
        if ( !(Get-ADUser -Filter {name -eq $account}) ) {        
            Write-Host "Adding user: $account"
            New-ADUser $account -GivenName $fn -Surname $ln -Description $desc -Enabled 1 `
            -DisplayName ($fn + " " + $ln)  -AccountPassword $pwd -ChangePasswordAtLogon $true `
            -Path "OU=$OU,$ADDomainName"
        else {
            Write-Host "User already exists: $account"
    Function addGroup($ADgroup, $ADDomainName, $OU) {
        if ( !(Get-ADGroup -Filter{name -eq $ADgroup}) ) {          
            Write-Host "Adding group: $ADgroup"
            New-ADGroup -Name $ADgroup -GroupCategory Security `
            -GroupScope Global -Path "OU =$OU,$ADDomainName" 
        else {
            Write-Host "Group already exists: $ADgroup"
    ### MAIN PROGRAM
    if( !$filename ) {
        # prompt the user to select a file to process
        [System.Reflection.Assembly]::LoadWithPartialName("system.windows.forms")
        $dialog = New-Object System.Windows.Forms.OpenFileDialog
        $dialog.Filter = "XML Files (*.xml)|*.xml|All Files(*.*)|*.*"
        $dialog.Title = "Select an XML file to import“
        $result = $dialog.showdialog()
        if ( $result -eq "ok" ){
            $filename = $dialog.Filename
    $userfile = [xml](Get-Content $filename)
    $ADDomainName = (Get-ADDomain).DistinguishedName
    foreach( $user in $userfile.root.userManagement.user ) {
        $account = $user.account
        $fn = $user.firstname
        $ln = $user.lastname
        $desc = $user.description
        $pwd = ConvertTo-SecureString -AsPlainText $user.password -force
        $mgr = $user.manager
        $OU = $user.ou
        Write-Host
        Write-Host $account
        Write-Host $fn
        Write-Host $ln
        Write-Host $desc
        Write-Host $user.password
        Write-Host $mgr
        Write-Host $OU
        createOU $OU $ADDomainName
        foreach( $groupmem in $user.memberof.group ) {
            $ADgroup = $groupmem
            addGroup $ADgroup $ADDomainName $OU
            addUser $account $fn $ln $desc $pwd $OU $ADDomainName $ADgroup
            Add-ADGroupMember $ADgroup -Members $account      
    #Local Management
    $computers = Get-ADComputer -Filter * | where {-not($_.distinguishedname -like "*OU=Domain Controllers*")}| `
    foreach{$_.name}
    Write-Host "Computers that already exsist on the Network:"
    foreach($computer in $computers) {
    $DomainName =(Get-ADDomain).NetBIOSName
    $localgroups = $userfile.root.localGroupManagement.localGroup
        foreach($lg in $localgroups.name) {
            try {   
                $newgrp = [adsi]::Exists("WinNT://$computer/$lg,group")
                if($newgrp -eq $true) {
                    Write-Host "$lg Already Exists!"
                else {
               $ds=[adsi]("WinNT://$computer,computer")
               $group=$ds.create("group",$lg)
                    $group.setinfo() 
            catch [Exception] {
    write-host "Exception"
    I have tried other methods, but this is the one I receive the least amount of errors on. The script starts to have issues here:   $newgrp = [adsi]::Exists("WinNT://$computer/$lg,group")
    I have looked information up about WinNT Exists and it appears it has some issues. I have been trying to figure out how to add the domain groups to the local computer's groups. The tricky part is that the script has to run without knowing the computer's
    name so it can run on any domain. If anyone could help me out with this last part I would be very grateful.

    The script should be using WinNT to find computers on the domain and add domain group to each of those computers local group. I have provided portions of the xml file and instructions to help clarify.
    Here is the portion of the xml file I'm having issues with
    <localGroupManagement>
    <localGroup>
    <name>Power Users</name>
    <members>
    <group>Marx Brothers</group>
    </members>
    </localGroup>
    <localGroup>
    <name>Musicians</name>
    <members>
    <group>GGMusicians</group>
    </members>
    </localGroup>
    </localGroupManagement>
    </root>
    Here is what the assignment is assuming.
    Assumptions
    The computer the script is running on will be in the domain that you wish to manage. 
    The computer running the script will have the Active Directory PowerShell module installed.
    The user running the script will have rights to do all required tasks

  • Z Tcode doesn't write the last part of program

    Hi experts,
    I have a program in a transaction code, and the last part, must be write:
    Send it to the world
        lv_sent_to_all = lo_send_request->send( i_with_error_screen = 'X' ).
        IF lv_sent_to_all = 'X'.
          WRITE 'Email Sent Successfully'.
        ENDIF.
        COMMIT WORK.
      CATCH cx_document_bcs INTO bcs_exception.
        WRITE: 'Error Occurred'. WRITE: 'Error Type', bcs_exception->error_type.
        EXIT.
    ENDTRY.
    If I execute only the program, the write works correctly.
    But if I execute the tcode (X) with the program, no write is working.
    Someone knows about it??? Why is working if you execute the program and not when you execute the transaction??
    thanks you very much!

    Its simple. While creating transaction code in SE93, u might have selected radio buton Program and screen (dialog transaction)
    It should be 2nd option Program and selection screen (report transaction)
    Create another transaction code selecting radio buton Program and selection screen (report transaction) and run the transaction code. It will work

  • Why is the last part of the Word Press install not working?

    I am installing Word Press to work in Dreamweaver. I have installed MAMP and everything is working fine, I assume. The location of the files are /applications/MAMP/htdocs/wp-content/themes/twentyten.
    I have installed PHP/MySql on my machine and have set up the wordpress database as instructed. The last part of the process has me bogged down. In following step one of the process, I get a blank screen. Here's the url: http://localhost/wp-admin/install.php and the instructions to complete the process.
    With the WordPress files copied to the correct location in the htdocs folder, the web server installed, and a database created, open a browser and browse to http://localhost/wp-admin/install.php.
    A screen telling you to create a configuration file will appear. Click the Create a Configuration File button.
    Click the Let’s Go button to go to a page that allows you to enter your database information.
    Type your database name, wordpress.
    Type your MySQL user name and password (usually the user name and password are both admin, unless you changed them in the database).
    For the Database Host type localhost.
    Click Submit
    Can anyone help?
    Thank for your help,
    GWalton55

    I'm stuck installing virtualhosts in DW and using Wordpress templates, but I may be a few steps further than you are, so I'll try to help. I'm also using Windows, so who knows?
    I'm assuming you are not using a virtual host, just a local host; therefore, I went to the section that has instructions for the steps you are on in David Powers' "Adobe Dreamweaver CS5 with PHP: Training from the Source" and right after he has you launch the browser and open "wordpress/wp-admin/install.php" in "your [site name here] site." He goes on to write:
         The URL depends on how you set up your testing environment:
    Virutal host: http://[site name here]/wordpress/wp-admin/install.php
    Localhost: http://localhost/[site name here]/wordpress/wp-admin/install.php
    NOTE: if you are using the MAMP default ports on a Mac, add :8888 after [site name here] for a virual host, or after a localhost.
    So perhaps that's what you're missing, I really don't know.
    Good luck!

  • Remove last selection for parameters

    Hello expert,
    I have a webi report with multiple parameter inherited from store procedure on which universe is built up. how can I remove last select variant for all parameters ? I mean for every running, I want to select parameters from scratch. but currently in my report, parameters display last selection.
    Many Thanks,

    Hello,
    I believe if you go into the universe and right click on the stored procedure, it should give you an edit option. Then you should be able to select the parameter and change it to "Prompt for a value" or something like that. There are probably some other posts regarding how to do this. I am not sure I have it all correct since I don't have BO up right now, but pretty sure I have done it before.
    Thanks

  • Remove last 4 digits

    Hi all,
    I want to remove last 4 digits from my numerical no. how can i do this?
    Plz help me.

    hi
    good
    w_level_03 = strlen( W_STRING ).
    lv_offset = w_level_03 - 4.
    w_string2 = w_string +(lv_offset).
    or
    w_string2 = w_string +0(lv_offset).
    Eg:-
    str = "testing1234".
    int offset = strlen( str ) - 4.
    str = str+0(offset).
    thanks
    mrutyun^

  • Remove last 3 char ..

    Hi ,
         I need to remove last 3 char from my varible which is char 30.
    For example : WERKS = 1000 and .
    I need to remove last 3 char (and) from the above varibale .Kindly guide this
    Regards,
    VC

    Hi veerachamy,
    Just copy this code..it will work fine even if the field changes dynamically..
    I took w_char as 30 char..u can give ur field name there...
    data:
    w_char(30) type c value 'asdfghjklpoiu',
    w_tmp(30) type c,
    w_tmp1 type i.
    w_tmp1 = strlen( w_char ).
    w_tmp1 = w_tmp1 - 3.
    w_tmp = w_char+0(w_tmp1).
    write: w_tmp.
    Hope it resolves the issue...
    Regards
    Kiran

  • Elements 9 Projects plays fine on computer however when burned to a DVD it drops the last part

    Hello,
    this is my first post and first Question ever on Adobe site. I hope thatt someone can help. I have used Elemenys 3.0 for a number of
    years. I have now upgraded to Elements 9. I am having an odd problem with a project that I am working on. Everything seems to be OK on the EDIT
    and on  the DVD PREVIEW mode ; However when burned to a DVD, I am loosing the last part of the project, and the laat  scene button does not take me to the correct scene, It takes me to the one just BRFORE it. When the burning process is done, it shows that it all went well. No error messages. Does anyone have any thoughts as to what is causing this?

    hi photonutguy,
    Since your question is about burning your video to a DVD disc, it is actually an Adobe Premiere Elements question. This forum is specifically about Photoshop Elements and is frequented by people who use Adobe Photoshop Elements for their photos.
    there is a separate forum for Adobe Premiere elements where you will find the people knowledgeable in the video process for burning that DVD with menus at
    http://forums.adobe.com/community/premiere_elements
    So  I recommend that you post your question at that Premiere Elements forum .

  • When i sync my iphone5 on my computer with itune the last part does not stop sync download safari i dont know why is not sync and i cant stop it i am try to download some song and this thing cant stop sync help?

    when i sync my iphone5 on my computer with itune the last part does not stop sync download safari i dont know why is not stop sync and i cant stop it i am try to download some song and this thing cant stop sync help?

    Hi,
    /Users/sarahschadek/Desktop/Safari.app/Contents/MacOS/Safari
    Move the Safari app from the Desktop to the Applications folder.
    Restart your Mac.
    That's why you see this:
    When I try to do the updates my computer says it has ready it goes through like it is downloading them then at the end it says some of the files could not be saved to "/" files.
    After your restart your Mac, click the Apple  menu (top left in your screen) then click:  Software Update ...
    Carolyn  

  • The theme/background (AWESOME futuristic space scene) shown in the last part of "Getting Started video available for download?

    In the last part of the video "Getting Started" right after I downloaded Firefox 4, there was a background scene of an awesome page that showed some futuristic space scene that has the mozilla theme (fox) in the picture. I would like to know if it is available for download and/or it's name. I searched through the themes, but they don't show enough of the theme to actually see what the background would be once downloaded. Thank you in advance for any help you can offer.
    Gina Taylor

    Maybe you like this video as well:
    * http://vocamus.net/dave/?p=1233 Flight of the Navigator
    * http://videos.mozilla.org/serv/mozhacks/flight-of-the-navigator/
    * http://blog.vlad1.com/2010/12/21/webgl-in-firefox-4-beta-8/

  • Get last part of strings

    Hello,
    I have a table like bellow
    id group_name
    1 TW Product Analyst PE
    2 TW Tech Support Analyst SP
    3 TW Tech Support Manager CE
    4 TW Manager SP
    5 Another Group Without End With 2 Characters
    6 TW Product Coodinator MG
    I would like to get just the last part of strings that ends with 2 characters(these 2 characters are states in Brazil).
    The query answer need to seems like bellow
    id group_name
    1 PE
    2 SP
    3 CE
    4 SP
    6 MG
    I appreciate any kind of help.
    Thanks

    user5495111 wrote:
    Another way
    with d as (
    Select 1 id, 'TW Product Analyst PE' group_name from dual union all
    Select 2, 'TW Tech Support Analyst SP' from dual union all
    Select 3, 'TW Tech Support Manager CE' from dual union all
    Select 4, 'TW Manager SP' from dual union all
    Select 5, 'Another Group Without End With 2 Characters' from dual union all
    Select 6, 'TW Product Coodinator MG' from dual
    select id, substr(group_name, -2)
    from d where id not in(select id from d where trim(substr(group_name,-3,1)) is not null)
    This will not work if the fifth row id is null
    with d as (
    Select 1 id, 'TW Product Analyst PE' group_name from dual union all
    Select 2, 'TW Tech Support Analyst SP' from dual union all
    Select 3, 'TW Tech Support Manager CE' from dual union all
    Select 4, 'TW Manager SP' from dual union all
    Select null, 'Another Group Without End With 2 Characters' from dual union all
    Select 6, 'TW Product Coodinator MG' from dual
    select id, substr(group_name, -2)
    from d where id not in(select id from d where trim(substr(group_name,-3,1)) is not null)
    no rows selectedInstead or NOT IN use IN Clause
    with d as (
    Select 1 id, 'TW Product Analyst PE' group_name from dual union all
    Select 2, 'TW Tech Support Analyst SP' from dual union all
    Select 3, 'TW Tech Support Manager CE' from dual union all
    Select 4, 'TW Manager SP' from dual union all
    Select null, 'Another Group Without End With 2 Characters' from dual union all
    Select 6, 'TW Product Coodinator MG' from dual
    select id, substr(group_name, -2)
    from d  a where id in  (
         select id from d b where trim(substr(group_name,-3,1)) is null)
            ID SU
             1 PE
             2 SP
             3 CE
             4 SP
             6 MG
    5 rows selected.SS

  • Pixma Pro-100 Leaving Smudges/Streaks on last part of 13x19" print

    Hi guys, I am in desperate need of help as I have several customer orders that I can't fulfill because my printer just stopped functioning correctly today. I have a Pixma Pro-100, and I have printed several hundred 13x19" prints with it. Today, it started adding black smudges/streaks on either side of the last few inches of every 13x19" print. I cleaned the printhead, aligned it, cleaned the nozzles, and even took the printhead out and cleaned it using the "soak in shallow water" method, before letting it dry completely. It still produces the same black smudges/streaks on either side of the last few inches of the prints.  When I remove the printhead after a print, I can notice what looks like black ink build up all around the bottom brown part where the ink sprays out from the printhead. I've tried wiping it off with an alcohol wipe and reinstalling the printhead. Nothing seems to work.  I should also note that the sponge that soaks up excess ink inside the printer seems to be really full of wet ink. I tried soaking up as much as I could with paper towels and got quite a lot of it out of there. It seems to me that this couldn't be the problem, though, because the smudges are on the printed side of the paper and not the rear side. Can anyone help me, please? 

    I have the same general problem. I have performed the roller cleaning several times, the bottom plate cleaning maybe 30 times with various weights of paper, I have ink streaks and excessive ink on prints of about  3/16" x 2-3" streaks x 3 to 4 of them groued in upper left corner, and misc spots. I recently chnaged ink cartdriges (canon) becasue the black was not printing correctly. So I repalced all of them and now the splotches/streaks occur. 

Maybe you are looking for

  • IPhone 6 plus speaker is not working on phone

    Speaker not working on phone calls

  • AMT8. Help me to setup it! Please:-)

    Hi! I download unitor control and emagic mididrv from apple site. Install it. I open logic and open pref (sync). In unitor tab I have "Device Firmware not reconized". It is normal? In manual of AMt I see:" open Unitor8 preferences and chek SoundSurfe

  • Lion or Mountain Lion or Mavericks?

    Hi I just purchased a macbook pro -love it- now it has osx 10.8.5...is that Lion or Mountain Lion? and should i upgrade to Mavericks? if so why? I appreciate any answer. I am used to Pc and that is why i need to ask questions... thank you and have a

  • Purchase order output error....

    Hi, Purchase order is created from a shopping cart.But PO output(via email) is not created.I am getting output error.Error log is showing message as "Incorrectly processed". Error message description is "SUM OF PERCENTAGE EXCEEDS..." and "TABLE TEM_D

  • CS5 Photomerge - how to avoid those strange jig-saw lines in the sky

    Here is one image out of 4 that I am merging [just an example of one of many I do] you will note that the sky area to the left of the rainbow is clear and normal. When using Photomerge direct from bridge and on RAW files regardless of resolution I am