Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
cspindley
New 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

Re: ratio

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.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
arpitkharkia
Contributor III

Re: ratio

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