Dividing Numbers
Answered
Is it possible to get remainders when dividing numbers in BMC Smart Reporting ?
I'm currently dividing second to last column with UkIn column and getting whole number division.
Is there some setting that I need to set correctly to get values that I need.
For example for first row I need to get in last column 8.33% ( (1/12)*100 ) but I'm getting 0.
The Ukupno Incidenata (UkIn) field:
Unutar 24 sata (ukupno) field:
Where Hours to Resolve is:
And Unutar 24 sata (%) is:
With format set to:
Hi Stefan,
Thanks for reaching out. This has actually been logged by BMC themselves before and it turns out that This is related to how the values are being handled by the BMC driver (we have not been able to replicate on other dbs).
To use a simplified example, the integer 20 divided by the integer 7 will return 2. If these were treated as floats, the float 2.8 would be returned, but they're being treated as integers in BMC's driver. The SQL statement from Yellowfin is sending out 20/7 no matter what. In MySQL for instance, the SQL statement that Yellowfin sends returns 2.8571... because it recognizes these as float values. If we were now to put ".0" after these integers, then it forces the driver to recognize 20/7 as float values and return the desired result.
In terms of accomplishing this when referencing a column itself in a calculated field, considering the values are recognized as Integers by default, I'd guess this normally would be done by drafting a Freehand SQL CAST statement to convert the values to float values... Something like CAST(SUM(sl.parts) AS FLOAT), but I don't think Smart Reporting allows its users to draft Freehand SQL statements. As such, if you have further trouble with this though, please reach out to your BMC contact to assist further as they should have a better understanding of how their driver works and I'd guess they'd already know how to get around this, if possible given the Smart Reporting setup.
Please let me know if you have any further questions.
Regards,
Mike
Hi Stefan,
Thanks for reaching out. This has actually been logged by BMC themselves before and it turns out that This is related to how the values are being handled by the BMC driver (we have not been able to replicate on other dbs).
To use a simplified example, the integer 20 divided by the integer 7 will return 2. If these were treated as floats, the float 2.8 would be returned, but they're being treated as integers in BMC's driver. The SQL statement from Yellowfin is sending out 20/7 no matter what. In MySQL for instance, the SQL statement that Yellowfin sends returns 2.8571... because it recognizes these as float values. If we were now to put ".0" after these integers, then it forces the driver to recognize 20/7 as float values and return the desired result.
In terms of accomplishing this when referencing a column itself in a calculated field, considering the values are recognized as Integers by default, I'd guess this normally would be done by drafting a Freehand SQL CAST statement to convert the values to float values... Something like CAST(SUM(sl.parts) AS FLOAT), but I don't think Smart Reporting allows its users to draft Freehand SQL statements. As such, if you have further trouble with this though, please reach out to your BMC contact to assist further as they should have a better understanding of how their driver works and I'd guess they'd already know how to get around this, if possible given the Smart Reporting setup.
Please let me know if you have any further questions.
Regards,
Mike
Hi Stefan,
Thanks for reaching out. This has actually been logged by BMC themselves before and it turns out that This is related to how the values are being handled by the BMC driver (we have not been able to replicate on other dbs).
To use a simplified example, the integer 20 divided by the integer 7 will return 2. If these were treated as floats, the float 2.8 would be returned, but they're being treated as integers in BMC's driver. The SQL statement from Yellowfin is sending out 20/7 no matter what. In MySQL for instance, the SQL statement that Yellowfin sends returns 2.8571... because it recognizes these as float values. If we were now to put ".0" after these integers, then it forces the driver to recognize 20/7 as float values and return the desired result.
In terms of accomplishing this when referencing a column itself in a calculated field, considering the values are recognized as Integers by default, I'd guess this normally would be done by drafting a Freehand SQL CAST statement to convert the values to float values... Something like CAST(SUM(sl.parts) AS FLOAT), but I don't think Smart Reporting allows its users to draft Freehand SQL statements. As such, if you have further trouble with this though, please reach out to your BMC contact to assist further as they should have a better understanding of how their driver works and I'd guess they'd already know how to get around this, if possible given the Smart Reporting setup.
Please let me know if you have any further questions.
Regards,
Mike
Hi Stefan,
Thanks for reaching out. This has actually been logged by BMC themselves before and it turns out that This is related to how the values are being handled by the BMC driver (we have not been able to replicate on other dbs).
To use a simplified example, the integer 20 divided by the integer 7 will return 2. If these were treated as floats, the float 2.8 would be returned, but they're being treated as integers in BMC's driver. The SQL statement from Yellowfin is sending out 20/7 no matter what. In MySQL for instance, the SQL statement that Yellowfin sends returns 2.8571... because it recognizes these as float values. If we were now to put ".0" after these integers, then it forces the driver to recognize 20/7 as float values and return the desired result.
In terms of accomplishing this when referencing a column itself in a calculated field, considering the values are recognized as Integers by default, I'd guess this normally would be done by drafting a Freehand SQL CAST statement to convert the values to float values... Something like CAST(SUM(sl.parts) AS FLOAT), but I don't think Smart Reporting allows its users to draft Freehand SQL statements. As such, if you have further trouble with this though, please reach out to your BMC contact to assist further as they should have a better understanding of how their driver works and I'd guess they'd already know how to get around this, if possible given the Smart Reporting setup.
Please let me know if you have any further questions.
Regards,
Mike
Hi Stefan,
I'm going to go ahead and mark this one as Answered since I haven't heard back from you and I suspect I've covered your query, but if you have further questions or concerns on this, if you respond, it will re-open the case and put it back in my queue and I'll be happy to help.
Regards,
Mike
Hi Stefan,
I'm going to go ahead and mark this one as Answered since I haven't heard back from you and I suspect I've covered your query, but if you have further questions or concerns on this, if you respond, it will re-open the case and put it back in my queue and I'll be happy to help.
Regards,
Mike
Replies have been locked on this page!