Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
How do I create a ratio (not as a percentage)...
For example, I have a sales value of 1754 and a demo value of 764
How can I display the sales:demo ratio (1754 : 764) in its lowest form?
Many thanks
dual( sales_value & ' : ' & demo_value, sales_value/demo_value)
Or are you asking how to calculate the greatest common divisor? There's no Qlikview function to do that. You'll have to calculate it before hand or use a macro.
But gwassenaar this won't be in its lowest form. The lowest form would be displaying it as 877:382
Am I correct sabahsdada ? This is what you are looking to do???
Yes you are right, I need to see this value in its lowest form
you can try doing it in the script.
see the link below:
How to calculate the GCD(Greatest Common divisor)
once you have the gcd value, then u can use the formula,
=salesvalue/GCDfield &":"&demovalue/GCDfield
Hope it helps
Used a macro to achieve what you wanted (Found the macro here: How to calculate the GCD(Greatest Common divisor))
Please find attached the application and see if this is helpful.
Best,
Sunny
='1 : '&round( demo_value/sales_value ,2)