How to use custom variables in Grafana?

I have a variable which is the number variable, I want to build a custom variable. It can take a modulo operation on that number variable. How can I do it?

Such as the id variable is 1091521, I want use the id to take a modulo operation to get the constant variable.