I am trying to calculate % value, in some case the denominator could be blank or zero and if I divide by blank or zero, it gives me infinity but I want the value as zero, not sure how to add in the formula.
Example: my formula is (month3 minus month2)/month2
- I am trying to calculate percentage change between month3 and month2. In the data set I am getting some values for month 2 as zero or blank, how to take care in the code.
dataset["USAGE_MONTH2_INCREASED"]=(
(dataset.MNTH2_ACTUAL_USAGE_CDK-dataset.MNTH1_ACTUAL_USAGE_CDK) /
dataset.MNTH2_ACTUAL_USAGE_CDK)