Hello, it has been a while since last used scriptcase, lately had an idea wanted to make a small project to test it out, however, as it involves many math operators, I’m kind of stuck in couple of points, thought to post them here for possibility if something similar stuff…
1- in grid application, assume i have a calculated_field called {field_x} created by scriptcase that gets data by combining 2 piece of data from col A and col B (which are DB fields) results as field X = ‘XXMB1’ ‘XXMB2’, ‘XXMB3’ … in total, like 60 or 70 values repeated over a long grid full of raws…
example:
Feld A …Field b … field X
BV … 1 … XXMB1
CV… 3 … XXMB3
TG … 4 … XXMB4
NB … 2 … XXMB2
SB … 1 … XXMB1
How to state, how many XXMB1 and XXM2… are there, is there a way to count, and output, say under the grid or get it as variable or something?.. I tried all built in total options like Count, Distinct Count… those basically give the row count, which is not what I want, i obviously look to have something like XXMB1 = 2 times, XXMB2 = 17 times, XXMB3 = 40 times… etc.
2- assume this mysql table:- presented by scriptcase grid application
sn … grade . class . marks . hours
1… 1…3…2…33
2…2…1…22…44
3…14…1…24…11
4…14…1…24…22
etc.
i need a new field, created by scriptcase type integer to calcuate the difference between hours in row1 and hours in row2 so we have something like
sn … grade . class . marks …hours… different
1… 1…3…2…33… … NA (its the first row)
2…2…1…22…44 … 10 the difference between row 2 and 1/above) - field {hours}
3…14…1…24…11 … 33- the difference between row 3 and 2/above) - field {hours}
4…14…1…24…22… 11 (the difference between row 4 and 3/above) - field {hours}
etc.
Last over here, it is obvious you can’t set sorting or group by (static) using calculated fields (fields created by scrtiptcase) only database fields… anybody got a workaround?
Appreciate your thoughts and inputs
Cheers