MOD() Artithmétic

Hi,

To validate an input (qrcode scan), I would like add a condition : valid if and made a checking with mod().

mod((mid([_thisrow],15,8)),98)
it's not working, I receive : "MOD has invalid inputs"

If I try simly  in a virtual field 
mid([_thisrow],15,8)),98
it's work

If I try simply
mod([QRC],98) (or other) I receive : "MOD has invalid inputs"

If I try simply
mod(12345,456789)

It's work.

 

Any idea ?

 

Solved Solved
0 2 105
2 ACCEPTED SOLUTIONS

Aurelien
Google Developer Expert
Google Developer Expert

Hi @atyka 

I think MOD is expecting number. It's may be not the case ?

Plus, MOD() returns a number. You may want to compare it to zero in your Valid_If condition ?

What about:

MOD(
  NUMBER(MID([_THISROW],15,8))
  ,98
)=0

For reference:

MOD() - AppSheet Help

NUMBER() - AppSheet Help

 

View solution in original post

YES it was a format problem. It's work with : 

mod(number(text(mid([_thisrow],15,8))),98)=right([_thisrow],2)

View solution in original post

2 REPLIES 2

Aurelien
Google Developer Expert
Google Developer Expert

Hi @atyka 

I think MOD is expecting number. It's may be not the case ?

Plus, MOD() returns a number. You may want to compare it to zero in your Valid_If condition ?

What about:

MOD(
  NUMBER(MID([_THISROW],15,8))
  ,98
)=0

For reference:

MOD() - AppSheet Help

NUMBER() - AppSheet Help

 

YES it was a format problem. It's work with : 

mod(number(text(mid([_thisrow],15,8))),98)=right([_thisrow],2)

Top Labels in this Space