Jump to content

How to auto insert the next week progress when users do not key in manually?


Recommended Posts

image.png.b21ff5db36ef92deb7d04fa1bc9d0c4a.png

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?

 

image.png.1c4f88dedaedad5f9987f87ab363b853.png

image.png.7bf4af2cb7db0a49ccea19c0c08e5ec9.png

Thank you so much for your help !!!

 

Edited by Yean95
Link to comment

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%").

Link to comment
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.

Link to comment

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.
image.png.aab0b032e14af2bc3e0b3c231b0ba650.png

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 by Lipko
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.