Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
cspindley
Contributor III
Contributor III

ratio

hello Qlik builders, i am looking fo rsome logic (function / code) that given to integers will return a ratio, e.g.

4 and 2 would return 2 : 1

12 and 8 and would return 3 : 2

35 and 25 would return 7 : 5

...

not as easy as you might think !

Labels (1)
2 Replies
Anil_Babu_Samineni

How this value returns?

35 and 25 would return 7 : 5 -- If output you need as 3.5 : 2.5 (We can achieve). If logic different, please explain the logic too.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
arpitkharkia
Creator III
Creator III

You have to use macros here and create a GCD(Greatest Common Divisor) function.

Please find the macro in the below link

https://community.qlik.com/t5/New-to-QlikView/Ratio/td-p/868157