Dear community, i have a hard time on this topic may be someone can help. My Datatable comprises many parts under "Serialnumber" that are measured at different point of time "Timestamp". The results of the Measurement (like Isc, Pmpp, ...)
ist stored in rows with increasing measurement time. What i need to do ist to normalize the measurement value with the very first measurement (earliest in time) for each part individually. Like Part XY -> (Pmpp/Pmpp0; t=0)
I wrote a script subsetting my big datatable into many subtables containing only one part and its consecutives measurement over time. As below code:
dt_LT = Open(big_datatable.jump);
Mod_Tab = dt_LT << Tabulate( Add Table( Row Table( Grouping Columns( :SerialNumber ) ) ) );
Mod_dt = Mod_Tab << Make Into Data Table;
Mod_dt << Set Name( "Modul-Datatable" );
Zahl_Mod = NRow (Mod_dt);
Current Data Table (Mod_dt);
Mod_List = :Name( "SerialNumber") << Get Values;
content= Text Box(Mod_List);
New Window ("Modul gefunden", content);
Current Data Table (dt_LT);
For (i = 1, i <= Zahl_Mod, i++,
dt_LT << clear row states;
dt_LT << select Where (:Name ("SerialNumber") == Mod_List[i]);
If( N Row( dt_LT << get selected rows ) < 3, Continue() );
Mod = dt_LT << Subset ((selected Rows), Output Table Name("Module_"||Mod_List[i]));
This works just fine. I get as many subtables as needed. Also find the earliest measurement in each subset works fine. See code below:
Current data table(Mod);
Eval (init_Zeit = col minimum(:Timestamp);
init_flash = Mod << get rows where ((:Timestamp) == init_Zeit);
row = init_flash[1];
What fails is the normalization. The script get stuck on the last subset and normalizes all other data with the earliest measurement of the last subset table. See the script below
Em0 = :Eff_Modul[row];
Ez0 = :Eff_Zelle[row];
FF0 = :FF[row];
Impp0 = :Impp[row];
Isc0 = :Isc[row];
Pmpp0 = :Pmpp[row];
Rs_Serial0 = :Rs_Serial[row];
Rsh_Shunt0 = :Rsh_Shunt[row];
Vmpp0 = :Vmpp[row];
Impp0 = :Impp[row];
Voc0 = :Voc[row];
New Column ("Pmpp_Norm", Numeric, continuous,
Formula ( :Pmpp / Pmpp0));
In the last subset table i get a 1 after normalisation in the measurement colunms In all other subtables i get a value that is below 1 for the normalized value. How can i switch between subset tables within the for loop? Can anybody help? Thx in advance
Mickael