My regex pattern looks something like
•$389 PER MONTH FOR 36 months $4,314 DUE AT SIGNING SUGGESTED DEALER
CONTRIBUTION OF $1,385 Offer not valid in Puerto Rico. Lease financing
available on new 2017 BMW 330i xDrive Sports Wagon models from
participating BMW Centers through BMW Financial Services through
January 02, 2018, to eligible, qualified customers with excellent
credit history who meet BMW Financial Services' credit requirements.
Monthly lease payments of $389 per month for 36 months is based on an
adjusted capitalized cost of $38,210 (MSRP of $45,595, including
destination and handling fee of $995, less $3,000 customer down, $0
security deposit and suggested dealer contribution of $1,385 and
$3,000 Holiday Lease Credit). Actual MSRP may vary. Dealer
contribution may vary and could affect your actual monthly lease
payment. Cash due at signing includes $3,000 down payment, $389 first
month's payment, $925 acquisition fee and $0 security deposit. Lessee
responsible for insurance during the lease term, excess wear and tear
as defined in the lease contract, $0.25/mile over 30,000 miles and a
disposition fee of $350 at lease end. Not all customers will qualify
for security deposit waiver. Tax, title, license and registration fees
are additional fees due at signing. Advertised payment does not
include applicable taxes. Purchase option at lease end, excluding tax,
title and government fees, is $27,813. Offer valid through January 02,
2018 and may be combined with other offers unless otherwise stated.
Models pictured may be shown with metallic paint and/or additional
accessories. Visit your authorized BMW Center for important details.
©2017 BMW of North America, LLC. The BMW name, model names and logo
are registered trademarks.
I want to match the number before months, which in this case is
36
However its coming out twice. is there a way to make it only match once?
I'm using \d+\s*(?=( months+?))
Thank you for your help!
Maybe you could find the first 36 before months from the start of the string and then capture it in a group:
^.*?(\d+)(?=\smonths)
Match the start of the string ^
Match any character 0 or more times non greedy .*?
Capture 1 or more digits in a group (\d+)
Positive lookahead if what follows is a whitespace and months (?=\smonths)
Related
I'm new to Power BI and struggling a bit with concepts. My simplified problem is this:
I have a table with time-track data (possible multiple entries per day for the same user):
datetime
timeTracked (hours)
user
2022-12-01 14:15
1.5
john
2022-12-01 16:30
0.5
john
2022-12-02 12:00
2.5
tom
I also have second table with yearly wages for each user (irregular dates, wage is applicable from that day forward):
date
user
wage
2021-01-01
john
20000
2021-06-15
tom
25000
2022-02-01
john
22000
I want to somehow calculate the cost for a dynamic period or total time, but using other filters (like client).
For example: total cost for current month - the sum of hours for each user multiplied by hourly cost (let's say yearly wage / 1500 for simplicity). The complication is that there might be multiple applicable wages in the selected period.
I'm not sure if I should create a new table, new column(s) to existing table(s), measure(s) or anything else? I don't know how to deal with this problem in Power BI, any hints, links or examples are very appreciated!
By default my currency display as INR (Indian Rupee) in SquareUp POS. How can I change INR to USD?
For the time being, the country of your account will determine the currency symbol and currency formatting of your Square Point of Sale app. I’ll pass your request to our product team for consideration as Square works to develop new features.
As an interim, you can create a Square account in the country of that currency to accept payments for that currency. So to be able to accept payments in $, you will need to create a United States Square account which requires a Social Security Number.
I have a problem importing a hierarchical text file into SAS.
I've been searching for the past week and had no luck.
The problem is that this file does not contain anything that indicates that the detail records are linked with the header.
I have tried the various methods explained with the. Input #1 Test # with the then do.
Extract of file (every new record starts with Hong Kong but each record has a variable number of lines):
HONG KONG
STEEL GROUP
Invoice Date
09.12.2015
Number
90035565
Delivery note no.
80006292
SAP Order number
18915
Customer number
105226
Order number
RCHEB 5114 1-1 24-11
Shipped from Saldanha bay, South Africa, per vessel
LAN MAY
Bill of lading date
14.11.2015
Port of discharge
ANY CHINESE PORT
Reference no.
Agreement/Contract/Order
OMl/24/ll
Port Wet Metric Tons Dry Metric Tons
ANY CHINESE PORT 202,079.000 199,957.171
Product % USD Value
Steel Ore 50%;29% 3,500.00
HONG KONG
TRADING CORP
Invoice Date
21.12.2015
Number
90035792
Provisional Invoice No
90033952
SAP Order number
50005313
Customer number
102872
Order number
KITST 5007 1-1 21-11
Shipped from Saldanha bay, South Africa, per vessel
HEBEI SUCCESS
Bill of lading date
15.06.2015
Port of discharge
BEILUN
Reference no.
WUGANG
Agreement/Contract/Order
OM6/21/ABG
Port Wet Metric Tons Dry Metric Tons
BEILUN 124,772.000 122,214.174
Product % USD Value Sishen 63.5%, 8 mm Fine Ore
Steel Ore 50%,10% 2,500.00
Iron Ore 20%,80% 1,500.00
Unfortunately, there is not an easy way to do this in SAS (that I know of). I think you are the right track reading the file in, record by record, and writing logic in a data step to parse it.
I would do it like this:
data blah;
infile "stuff.txt";
format inStr $2000.;
input inStr $;
if strip(inStr) = "HONG KONG" do;
...
end;
else if ... then do;
...
end;
...
run;
I am creating a spreadsheet to track rent owed from agents at a real estate company. I have drop-down lists created to pick from the agent and the type of transaction (Payment, Rent Incurred, Credit Issued, Fee Issued, Payment Reversed, Copier Usage). What I want is to just enter the number in the Amount field without making it a negative, and have a formula that will add it or subtract it based on the type of transaction it is. I want this:
If C2="Payment" OR "Credit Issued", then D2=POSITIVE
If C2="Rent Incurred" OR "Fee Issued" OR "Payment Reversed" OR "Copier Usage", then D2=NEGATIVE
Is it possible to do a formula like that in conjunction with a running balance?
Like this:
Date Agent Transaction Amount Balance
8/25/15 Mike Payment $150.00 -$150.00
9/1/15 Joyce Rent Incurred $200.00 $ 50.00
9/1/15 Mike Rent Incurred $150.00 $200.00
9/1/15 Chris Rent Incurred $250.00 $450.00
9/6/15 Chris Payment $250.00 $200.00
9/15/15 Joyce Fee Issued $ 25.00 $225.00
9/21/15 Joyce Payment $225.00 $ 0.00
I guess I want my balance formula to be like this:
=if(c2,"Payment""credit issued",d2*-1,c2,"Rent incurred""fee issued""copier usage""payment reversed",d2)+c1
Does this make any sense at all?
A formula that may be entered in E2, and filled down:
=N(E1)+D2*IF(OR(C2="Payment",C2="Credit Issued"),-1,1)
I have a giant data frame which I would like to turn into a more usable format. It is based on a copy-pasted text file of a schedule, where the entries have a consistent format.So, I know that each day will have the format:
###
Title - Date
First event
Time: 11:00 AM
Location: Address
Address line 2
Second event description
Time: 12:00 AM
Location: Address
Address
###
What I am having trouble with is figuring out how to parse this. Basically, I want to store everything between the "###"'s as a single day, and then add events based on how many times the above format repeats, and make a string or datetime entry based on if letters are following a "Time:" or a "Location:".
However, I am really having trouble with this. I have tried putting it all into a giant dataframe where each line is a row, and then adding dummies for location rows, time rows, etc as seperate columns, but am not sure how to translate that into discrete days or events. Any help would be appreciated.
Data is public, so a sample is below -- it is a giant dataframe with one row for each row of text:
*Text*
###
The Public Schedule for Mayor Rahm Emanuel – January 5, 2014
There are no public events scheduled at this time.
###
The Public Schedule for Mayor Rahm Emanuel – January 6, 2014
Mayor Rahm Emanuel will greet and thank snow clearing teams from the Department of Streets and Sanitation.
Time: 11:30 AM
Location: Department of Streets and Sanitation
Salt Station
West Grand Avenue and North Rockwell Street
Chicago, IL*
*There will be no media availability.
Mayor Rahm Emanuel and City Officials will provide an update on the City’s efforts to provide services during the extreme weather.
Time: 2:00 PM
Location: Office of Emergency Management and Communications
Headquarters
1411 West Madison Street
Chicago, IL*
*There will be a media availability following.
Mayor Rahm Emanuel will greet and visit with residents taking advantage of a City warming center.
Time: 3:00 PM
Location: Department of Family and Support Services
10 South Kedzie Avenue
Chicago, IL**
*There will be no media availability.
**Members of the media must respect the privacy of residents at the facility, and can only film City of Chicago employees.
###
Edit:
An example output I would like is something like (sorry the code here is broken, not sure why!):
Date Time Description Location
December 4th 9:00 AM A housewarming party 1211 Main St.
December 5th 11:00 AM Another big event 1234 Main St.
If at all possible.
EDIT 2:
Basically -- I know how to pull all this stuff out of the columns. I think my issue may really be reshaping the data intelligently. I have split it into this giant dataframe with one column where each row is a string which corresponds to a row of text int he original schedule. I then have a bunch of columns like "is_time", "is_new_entry", "is_location" which are 1 if the row is a time, new entry beginning, or location. I just don't know how to reshape this into the output above.