How to find GCD of 3 numbers?
Hello Community,
I have a condition, where I have to calculate the "Greatest Common Divisor(GCD/GCF)" of three numbers in Anaplan so that I can utilize that GCD value to find the ratio.
In excel we have GCD function and directly we obtain the GCD value. So, is there any way we can do that in Anaplan.
Thanks
Puneeth HP
Comments
-
hendersonmj Member, ALL USERS, GroupMember, Employee, Certified Model Builder Posts: 5 Frequent Contributor
Use the modulus function MOD(x,y) to find common factors among a very big numbered list of factors. Use summary First non-blank or Last non-blank to find the least common factor and the greatest common denominator, respectively.
List 1: Name “Inputs” Three items “A”, “B”, “C” and with a top level “All”.List 2: Name “Factors#”, numbered list with like 9,999 items, add a top level item: "All"
Code = 2,3,…10,000 << Skip 1 because it is a factor of every integer. The LCF must be > 1.
Property (text) Display Name = CODE(ITEM(Factors#))
Property (number) NumVal = VALUE(Display Name)Module:
Name: “Enter Values”
Applies To: Inputs
Line Item: “Integer”
format: number, decimals 0
formula: noneModule:
name “Identify Common Factors”
Applies To: Values, Factors#
Line Item:
Name: “Is Factor?”,
format: Boolean,
formula = MOD(Enter Values.Integer, Factors#.NumVal) = 0
Summary: AllModule:
Name: “Least & Greatest Factors (Items)”
Applies To: Factors#
Line Item: “Least Common Factor”
Format: List, Factors#
Formula: IF Identify Common Factors.Is Factor? THEN ITEM(Factors#) ELSE BLANK
Summary: First non-blank. <<< this puts the least common factor item in the top level item Factors#.All.
Line Item: “Greatest Common Denominator”
Format: List, Factors#
Formula: IF Identify Common Factors.Is Factor? THEN ITEM(Factors#) ELSE BLANK
Summary: Last non-blank. <<< this puts the greatest common denominator item in the top level item Factors#.All.
Module:
Name: "LCF & GCD (Numbers)"
Applies To: <none>
Line Item:
Name: Least Common Factor
Format: Number, Decimals 0
Formula: VALUE(CODE('Least & Greatest Factors (Items)'.Least Common Factor))
Line Item:
Name: Greatest Common Denominator
Format: Number, Decimals 0
Formula: VALUE(CODE('Least & Greatest Factors (Items)'.Greatest Common Denominator))3 -
@hendersonmj
Thanks for this resolution.
Just one thought, what if GCD > 9999.
Thanks,
Puneeth HP0
Categories
- All Categories
- 2.3K Anaplan Community
- Academy
- Anaplan Talent Builder
- Model Design Course
- The Anaplan Way
- Archive
- 2 Idea exchange
- 62 Enterprise Scale
- 1.1K Extensibility
- 21 Intelligence
- 1.6K Planning & Modeling
- 331 Security
- Community Connections
- Connections
- Experiences
- Groups
- Personas
- Employees
- CS Toolkit
- Customer Care Center
- Forums
- Academy & Training
- Community Feedback & Updates
- Japan
- Anaplan Community Japan
- Anaplan Community Japan Knowledge Base
- HyperCare Japan
- JP-Central
- Support-Japanese
- Partners
- Partner Leadership Council
- Partner Product Council
- 724 Platform
- Anapedia
- App Hub
- Centers Of Excellence
- Extensions
- Planual
- Platform Updates
- 724 User Experience
- Profile Builder
- Resources
- Anaplan Advocates
- Anaplan Live!
- Community
- Community Advancement
- Community Connections
- Partner Program
- The Official Master Anaplanner Program
- Videos
- Welcome to the Anaplan Community!
- Success Central
- Support
- Case Portal Link
- Common Support Questions
- HyperCare Redirect
- Known Issues and Workarounds
- Support test page
- SupportFAQ
- Survey
- 2 Training Day Takeaways