Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am learning Mod function in qliksense. Below are the examples.
Examples | Results |
---|---|
Mod( 7,2 ) |
Returns 1 |
Mod( 7.5,2 ) |
Returns NULL |
Mod( 9,3 ) |
Returns 0 |
Mod( -4,3 ) |
Returns 2 |
Mod( 4,-3 ) |
Returns NULL |
Mod( -4,-3 ) |
Returns NULL |
In above table Mod(-4,3) returns value 2. how it got calculated. when "4" divided by "-3" how it's going to return value"2".
Can someone explain this
It's a quite complicated matter if the parameters aren't positive integers and there various logically + technically implications in regard where and in which tool it's used and which kind of handling respectively returning results are regarded as expected or not. A good starting point to dive deeper would be:
Without any special reason I suggest to ensure that all parameters are positive integers (applying ceil/floor() and abs() and/or alt() or range-functions to the parameters) or using another logic to get the needed results.
It's a quite complicated matter if the parameters aren't positive integers and there various logically + technically implications in regard where and in which tool it's used and which kind of handling respectively returning results are regarded as expected or not. A good starting point to dive deeper would be:
Without any special reason I suggest to ensure that all parameters are positive integers (applying ceil/floor() and abs() and/or alt() or range-functions to the parameters) or using another logic to get the needed results.