Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a calc like this :
=( Grade1/Garde 1 std) + (Grade2/Garde2standard)+...............................+ (Grade10/Garde10standard)
For today its 10 what if tomorrow there are many standards. Can you help me with the best solution. And this is the expression calc you can either advise me in data modelling (Scripting)wise or else in expression wise as well.
You could build the expression in the script using a loop and a variable.
let vFormula = (Grade1/Grade1standard);
For i = 2 to 10
Let vFormula = $(vFormula) & ' + Grade' & i & '/Grade' & i & 'standard)'
Next
Then use vFormula in the script. You may have to be careful with apostrophe's and use chr(39) etc.
ps. You can of course replace the 10 with a count of the possible options to make it dynamic...
But for static this is fine,
What if I have many calcs and selections considered
Ex : = Count(<Type = super,order='check'Grade1>/(Garde 1 std) + Count(<Type = super,order='check'>Grade2)/(Garde 2 std) . I think its better to write a big calc just heard from business team there is only 10 standards always.
Just thinking...........................................