Go Back  FlyerTalk Forums > Miles&Points > Airlines and Mileage Programs > Air Canada | Aeroplan
Reload this Page >

Calculator for SQM, Aeroplan miles, & SQD

Community
Wiki Posts
Search
Old Jul 25, 2021, 6:09 pm
FlyerTalk Forums Expert How-Tos and Guides
Last edit by: Adam Smith
If you have general questions about how to earn SQM/SQS/SQD, please see the status qualification thread.

If you have received an incorrect amount of SQx/points, please see the thread on missing/incorrect flight activity.

Calculator for SQM, SQD, and Aeroplan points
SQM/SQD Cowculator and its source code

canadiancow's TODO list:
  • SAS Go Light fares
  • Basic economy on any airline other than AC (is it just need a fare basis that ends in GT?)
  • Ineligible codeshares, like EY-marketed, EY-operated, AC-ticketed

Adam Smith's TODO list:
  • Add earning for VA
  • Check earning rates for AC basic economy
Print Wikipost

Calculator for SQM, Aeroplan miles, & SQD

Thread Tools
 
Search this Thread
 
Old Jun 3, 2020, 1:33 pm
  #241  
Moderator, Air Canada; FlyerTalk Evangelist
Original Poster
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,782
I've updated the spreadsheet with the new Etihad partnership. Until the cowculator is fully functional, I'll continue to keep it updated.

I've also added the cowculator to the wiki.
Adam Smith is offline  
Old Jun 3, 2020, 2:00 pm
  #242  
A FlyerTalk Posting Legend
 
Join Date: Sep 2012
Location: SFO
Programs: AC SE MM, BA Gold, SQ Silver, Bonvoy Tit LTG, Hyatt Glob, HH Diamond
Posts: 44,359
Originally Posted by Adam Smith
I've updated the spreadsheet with the new Etihad partnership. Until the cowculator is fully functional, I'll continue to keep it updated.

I've also added the cowculator to the wiki.
There's.... there's.... that's.... that name is already in use...
canadiancow is offline  
Old Jun 3, 2020, 2:03 pm
  #243  
Moderator, Air Canada; FlyerTalk Evangelist
Original Poster
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,782
Originally Posted by canadiancow
There's.... there's.... that's.... that name is already in use...
Is it? I thought that's how we were referring to this tool.
Adam Smith is offline  
Old Jun 3, 2020, 2:09 pm
  #244  
A FlyerTalk Posting Legend
 
Join Date: Sep 2012
Location: SFO
Programs: AC SE MM, BA Gold, SQ Silver, Bonvoy Tit LTG, Hyatt Glob, HH Diamond
Posts: 44,359
Originally Posted by Adam Smith
Is it? I thought that's how we were referring to this tool.
It's always referred to https://flyertalk.canadiancow.com/eyw/

I mean I don't really care. Honestly we can just call this the cowtool. And that. And everything else.
canadiancow is offline  
Old Jun 3, 2020, 2:30 pm
  #245  
Moderator, Air Canada; FlyerTalk Evangelist
Original Poster
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,782
Originally Posted by canadiancow
Oh, okay, I'll think of something else.

I mean I don't really care. Honestly we can just call this the cowtool. And that. And everything else.
Well no, it can't be the cowtool. It will get too confusing..
Adam Smith is offline  
Old Jun 4, 2020, 1:47 am
  #246  
A FlyerTalk Posting Legend
 
Join Date: Sep 2012
Location: SFO
Programs: AC SE MM, BA Gold, SQ Silver, Bonvoy Tit LTG, Hyatt Glob, HH Diamond
Posts: 44,359
EY flights must be ticketed by EY or ticketed and marketed by AC to be eligible.

Is there any such restriction for CX?

Edit:

Also, the cowculator has been updated. It now shows Aeroplan miles, and handles partners that award Aeroplan but not AQM.

Still missing:
  • It does not let you specify whether you have Altitude status, so assumes you get the 250 mile minimum
  • It does not let you specify whether you selected bonus Aeroplan miles, so assumes 0%
  • If you happen to have an EY-marketed, AC-ticketed flight, it's not eligible, but there's no way to specify that at all right now, so it will show up as earning Aeroplan miles
Things I'm unsure about and could use input on interpreting Aeroplan's rules:
  • For SA, Aeroplan says "Within South Africa is defined as flights btwn Johannesburg, Cape Town, Durban, East London and Port Elizabeth." I am treating that as "domestic", but I don't know if there are exceptions that I may not be catching (the only other chart is "international", so I assume it's safe)
  • For TP, I am only special-casing LIS-OPO and OPO-LIS. Aeroplan is a little confusing here.
Things I'm not even sure how to detect.
  • I am not handling SAS Go Light fares
  • I am almost certainly not handling basic economy on any airline other than AC (do I just need a fare basis that ends in GT?)
As a result, if you have anything that isn't explicitly mentioned above that is giving a "???" in any box, or a wrong number, please let me know.

My goal is to open-source this cowculator, but I need to decouple it from the cowtool first, and clean it up a bit so that people can contribute AQM% rules and city distances without having to learn a programming language.

Last edited by canadiancow; Jun 4, 2020 at 2:06 am
canadiancow is offline  
Old Jun 4, 2020, 8:57 am
  #247  
Moderator, Air Canada; FlyerTalk Evangelist
Original Poster
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,782
Originally Posted by canadiancow
EY flights must be ticketed by EY or ticketed and marketed by AC to be eligible.

Is there any such restriction for CX?
Yes, with CX, you only earn miles on AC codeshares, which effectively means they need to be ticketed by AC.

Also, the cowculator has been updated.
What if we called this one the "AQM Cowculator" and the other one the "EYW Cowculator"?

Things I'm unsure about and could use input on interpreting Aeroplan's rules:
  • For SA, Aeroplan says "Within South Africa is defined as flights btwn Johannesburg, Cape Town, Durban, East London and Port Elizabeth." I am treating that as "domestic", but I don't know if there are exceptions that I may not be catching (the only other chart is "international", so I assume it's safe)
The other domestic routes are operated by SA Express, which are no longer eligible for accumulation. So any domestic flight operated by SA will be eligible.

At least that's how it was when I checked this out after they first made that change to SA Express.

  • For TP, I am only special-casing LIS-OPO and OPO-LIS. Aeroplan is a little confusing here.
I just made the assumption that for that FNC route, they meant to include it with LIS<>OPO when they excluded it from the main table. It seems illogical that every domestic route would be eligible except that one.

Things I'm not even sure how to detect.
  • I am not handling SAS Go Light fares
  • I am almost certainly not handling basic economy on any airline other than AC (do I just need a fare basis that ends in GT?)
There are a few oddities that I simply decided were not worth the trouble to try to program. SAS Go Light was one of those. CX flights only earning if they're AC codeshares is another. The entire VA partnership. It just seemed like too much hassle to create a whole bunch of extra columns and formulae just to handle those little things. Especially because with Excel it's not easy to have something pop up after you pick an M fare on SK asking whether it was a Go Light fare, or asking whether your CX segment was an AC codeshare. Not impossible, but it's a lot of heavy lifting for very little return.

That's why I left the override column. Have a Go Light U fare on SK, and the calculator says you'll earn 50%? Just override it to 0%. VA flight that should earn miles, but calculator says 0%? Override it and put 100% or whatever. Back when there were a lot more of those exceptions, I had text flags that would pop up and warn that there might be an issue that might require an override, but I think I eliminated that when I did the big update (with big assistance from Bohemian1 ) a number of months back.

Could that be an easier way for you to resolve some of these things? Add an override option and maybe a text flag? If someone selects SK and it's a fare class that may be Go Light, pop up a thing saying "Note that SK Go Light fares earn no miles. If you purchased a Go Light fare, override the calculated earning rate with 0%.", or something like that? It might save you doing a lot of coding just to handle a few esoteric cases.

My goal is to open-source this cowculator, but I need to decouple it from the cowtool first, and clean it up a bit so that people can contribute AQM% rules and city distances without having to learn a programming language.
Cool! I would be happy to help keep it updated if that were done.
Adam Smith is offline  
Old Jun 4, 2020, 9:11 pm
  #248  
A FlyerTalk Posting Legend
 
Join Date: Sep 2012
Location: SFO
Programs: AC SE MM, BA Gold, SQ Silver, Bonvoy Tit LTG, Hyatt Glob, HH Diamond
Posts: 44,359
Okay I fixed the things you clarified. I moved my list of missing features the wiki so I don't have to keep posting updates.

For an override column, I suppose the easiest (from the user's perspective) is to just make the percentages editable, but that means there needs to be client-side logic (i.e. javascript, of which there is currently none) to update the totals. Me not being a front-end web engineer poses some slight challenges here
canadiancow is offline  
Old Jun 4, 2020, 10:17 pm
  #249  
Moderator, Air Canada; FlyerTalk Evangelist
Original Poster
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,782
Originally Posted by canadiancow
Okay I fixed the things you clarified. I moved my list of missing features the wiki so I don't have to keep posting updates.
Great work, as always. Thanks for all the contributions you make to the community here

(Although I'm slightly sad at how you're rendering my m4d Excel sk1llz obsolete )

For an override column, I suppose the easiest (from the user's perspective) is to just make the percentages editable, but that means there needs to be client-side logic (i.e. javascript, of which there is currently none) to update the totals. Me not being a front-end web engineer poses some slight challenges here
Could you just add the ability to type in an override after the fare class/brand? Like, could you type in "SK,CPH,ARN,M,0%" to override the default calculated percentage? Or maybe it needs a second comma to effectively leave the fare brand blank, I don't know how the code works. Or use a semicolon to separate any overrides. Or slash. I don't know. I'm not a programmer, just a simple finance guy.
Adam Smith is offline  
Old Jun 4, 2020, 10:49 pm
  #250  
A FlyerTalk Posting Legend
 
Join Date: Sep 2012
Location: SFO
Programs: AC SE MM, BA Gold, SQ Silver, Bonvoy Tit LTG, Hyatt Glob, HH Diamond
Posts: 44,359
Originally Posted by Adam Smith
Could you just add the ability to type in an override after the fare class/brand? Like, could you type in "SK,CPH,ARN,M,0%" to override the default calculated percentage? Or maybe it needs a second comma to effectively leave the fare brand blank, I don't know how the code works. Or use a semicolon to separate any overrides. Or slash. I don't know. I'm not a programmer, just a simple finance guy.
Yes, I can definitely parse any CSV you want. Or any format at all. I just want the input to be as simple as possible to create.

Right now, only the AC calculator looks at the brand, but I could just as easily allow "BA" to be parsed for all airline calculators as a 0% earning flight. Or I could allow specifying a number instead of a brand to force that %.

Are there are fares on any airline that earn Aeroplan at a different rate than AQM (other than things like CX/EY where AQM is 0)?
Or any fares on *A that earn Aeroplan but no AQM?

This is all very easy to do from a pure back-end approach (like if I had full PNR and eticket information already). The only challenge is allowing people to enter data in a way that makes sense to them.
canadiancow is offline  
Old Jun 4, 2020, 11:31 pm
  #251  
Moderator, Air Canada; FlyerTalk Evangelist
Original Poster
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,782
Originally Posted by canadiancow
Are there are fares on any airline that earn Aeroplan at a different rate than AQM (other than things like CX/EY where AQM is 0)?
Thankfully not.

Or any fares on *A that earn Aeroplan but no AQM?
I believe Basic Economy on UA is the only one.

The only challenge is allowing people to enter data in a way that makes sense to them.
Understood
Adam Smith is offline  
Old Jun 4, 2020, 11:37 pm
  #252  
A FlyerTalk Posting Legend
 
Join Date: Sep 2012
Location: SFO
Programs: AC SE MM, BA Gold, SQ Silver, Bonvoy Tit LTG, Hyatt Glob, HH Diamond
Posts: 44,359
Originally Posted by Adam Smith
I believe Basic Economy on UA is the only one.
Oops. Fixed.


Originally Posted by Adam Smith
Thankfully not.
Bearing in mind I intend to make this simpler, this is UA's calculator right now:

Code:
private val uaCalculator: EarningCalculator = { _, _, _, _, _, _, fareClass, _, ticketNumber ->
    val isAqdEligible = ticketNumber.startsWith("014")
    when (fareClass) {
        "J", "C", "D", "Z", "P" -> EarningResult(aqmPercent = 150, minimumMiles = 375, isAqdEligible = isAqdEligible)
        "O", "A", "R" -> EarningResult(aqmPercent = 125, minimumMiles = 313, isAqdEligible = isAqdEligible)
        "Y", "B" -> EarningResult(aqmPercent = 125, minimumMiles = 313, isAqdEligible = isAqdEligible)
        "M", "E", "U", "H", "Q", "V", "W" -> EarningResult(aqmPercent = 100, minimumMiles = 250, isAqdEligible = isAqdEligible)
        "S", "T", "L", "K", "G" -> EarningResult(aqmPercent = 50, minimumMiles = 125, isAqdEligible = isAqdEligible)
        "N" -> EarningResult(aqmPercent = 0, aeroplanPercent = 50, minimumMiles = 125, isAqdEligible = false)
        else -> EarningResult(aqmPercent = 0, minimumMiles = 0, isAqdEligible = false)
    }
}
Very simply to specify a different aqmPercent than aeroplanPercent. I just wouldn't want to have to deal with overriding both.
canadiancow is offline  
Old Jun 4, 2020, 11:42 pm
  #253  
Moderator, Air Canada; FlyerTalk Evangelist
Original Poster
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,782
If you're looking to simplify, you could take out the minimum miles, which is just 250 x aqmPercent. When I updated this a while back, I went through all of them to see whether it was needed, and in every case it was just that.

Well, there was one that was Calm Air or First Air or something where it still said 500, but (a) that page was ancient and (b) I think it might be one of the partnerships that recently ended. Either way, I was pretty sure they just never got around to updating it and even if it was 500, it wasn't worth the hassle given all the work for one so esoteric issue.
Adam Smith is offline  
Old Jun 5, 2020, 12:10 am
  #254  
A FlyerTalk Posting Legend
 
Join Date: Sep 2012
Location: SFO
Programs: AC SE MM, BA Gold, SQ Silver, Bonvoy Tit LTG, Hyatt Glob, HH Diamond
Posts: 44,359
Originally Posted by Adam Smith
If you're looking to simplify, you could take out the minimum miles, which is just 250 x aqmPercent. When I updated this a while back, I went through all of them to see whether it was needed, and in every case it was just that.

Well, there was one that was Calm Air or First Air or something where it still said 500, but (a) that page was ancient and (b) I think it might be one of the partnerships that recently ended. Either way, I was pretty sure they just never got around to updating it and even if it was 500, it wasn't worth the hassle given all the work for one so esoteric issue.
Yeah, there's a lot of stuff like that I can do. I almost did it from the start, but you get into all these airlines with 70%, 110%, etc., and I didn't want to do the research on how they round when I could just put the minimum in. But it's easy to validate after the fact in order to simplify everything.

UA is one of the easiest airlines, since it's all based on fare class. LH is harder. AC is currently 90 lines of logic, and I'm still not sure it's entirely right.
canadiancow is offline  
Old Jun 5, 2020, 12:12 am
  #255  
Moderator, Air Canada; FlyerTalk Evangelist
Original Poster
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,782
Originally Posted by canadiancow
Yeah, there's a lot of stuff like that I can do. I almost did it from the start, but you get into all these airlines with 70%, 110%, etc., and I didn't want to do the research on how they round when I could just put the minimum in. But it's easy to validate after the fact in order to simplify everything.
You could have just asked, since I've already done the research
Adam Smith is offline  


Contact Us - Manage Preferences - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service -

This site is owned, operated, and maintained by MH Sub I, LLC dba Internet Brands. Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Designated trademarks are the property of their respective owners.