You can try the script below.
- Copy-paste the script into Script Editor (in Application > Utilities).
- Make sure Script Editor.app is listed and checked at System Preferences > Security & Privacy > Privacy > Accessibility.
- Click anywhere in the table that looks like your first table in your post. (Note this is a "table" not a "sheet".)
- Click the triangle 'run' button in Script Editor.
- Click anywhere on the canvas of the sheet.
- Command-v to paste.
The new table will then appear automatically on that sheet. (If you don't like the default Header Column you can set up a blank table without a Header Column, click a cell in that table, and command-v or Edit > Paste and Match Format.)
SG
tell application "Numbers"
tell front document's active sheet
tell (first table whose selection range's class is range)
set vv to rows'scells'sformatted value
end tell
end tell
end tell
set text item delimiters to tab
set pasteStr to (vv's item 1 as text) & return #header row
set numRows to vv'slength
repeat with r from 2 to numRows
set qty to vv's item r's item 2
repeat qty times
set vv's item r's item 2 to 1 #set Qty to 1
set pasteStr to (pasteStr & vv's item r as text) & return
end repeat
end repeat
set the clipboard topasteStr
pasteStr#optional to view in Result pane