Yean95 Posted July 28, 2021 Report Share Posted July 28, 2021 (edited) Hello~ I have this database as above in which users will key in the progress by weekly. However, sometimes they do not have any progress on that week so they will not key in through my system. So my question is how do i make the system auto insert the next week progress same as the previous week when users do not key in their progress? FYI, the weeks are calculated from the day when they first keyed in the progress for that particular model. Below pictures are what i have done currently and I would like the system to auto insert the 20% for Pes1 on Week 2. Anyone know how to do that in LabVIEW? Thank you so much for your help !!! Edited July 28, 2021 by Yean95 Quote Link to comment
Lipko Posted July 28, 2021 Report Share Posted July 28, 2021 It's not clear for me what you are after. You simply want to fill the emply cells of the report table for presenting the data (second table in your post)? Or you want the data also be inserted automatically into the database you are referring to in your first paragraph? If the first, then fill the cells in a post-process loop (where you have the disabled structure), I think that would be simpler than handling this in the table generator code (the for loop in the middle). Go through the table row-by-row. Go through the cells in the row. Check if the cell is emplty. If it's emply, fill it with the previous cell value (that you store as a shift register and initialised as "0%"). Quote Link to comment
Yean95 Posted July 28, 2021 Author Report Share Posted July 28, 2021 5 hours ago, Lipko said: It's not clear for me what you are after. You simply want to fill the emply cells of the report table for presenting the data (second table in your post)? Or you want the data also be inserted automatically into the database you are referring to in your first paragraph? If the first, then fill the cells in a post-process loop (where you have the disabled structure), I think that would be simpler than handling this in the table generator code (the for loop in the middle). Go through the table row-by-row. Go through the cells in the row. Check if the cell is emplty. If it's emply, fill it with the previous cell value (that you store as a shift register and initialised as "0%"). My intention is the first, I just want to fill the empty cells of the report table when users do not key in data. Can you tell me more about post-process loop? I don't really know what is that. Thank you very much. Quote Link to comment
Lipko Posted July 29, 2021 Report Share Posted July 29, 2021 (edited) Sorry for the stupid choosing of words. I meant just normal for loops. With "post-process" I wanted to emphasize that I would decouple this empty-cell-filling logic from the logic that produces the table. Because you seem to have solved the much harder part of the full algorithm. It would be much harder to fix your existing code that generates the result table than to have another separate section that works on the already produced table. sigh... It's easier to write and post the code than to describe it. Place this one where you have your disabled structure now. In general, I prefer to have a sequence of loops that do one or a few tasks on the data at once than to have one complicated God loop that does everything. The performace loss of more loops is usually not that significant, unless you have huge data (an image for example). Even in that case the performance loss can be accepted for certain uses in favour of code maintainability. Edited July 29, 2021 by Lipko Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.