cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

How to merge 2 datasets by multy criteria?

Dears,

Please help to solve that case in Power Automate desktop:

I have 2 datasets with prefilled data, need to lookup in table2 by multy statements and copy data from table2[Column4] to table1[СуммаGL]

Andrey86_0-1721105743788.png

Ur help will greatfull for me

BR

Andrey

 

12 REPLIES 12

I’d do it in Excel and use Sumifs. I’m sure you could do something similar with sql, but SUMIFS in excel would definitely work. 

Use write to Excel to save them to one file with two tabs and have GPT write you a macro to fill in the column using sumifs.

then, PAD is just used to:

get tables

write tables to Excel

Run Macro

Read From Excel (now the new table is in PAD and you can do with it what you wish.)

 

if the tables are already in Excel and you just need to populate the column SUMIFS will do. 

 

good luck!

----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services at www.peakdigitran.com/appointments and you can find me on LinkedIn at https://www.linkedin.com/in/michael-annis-80903/,

Thank you. but no. I mut use only PAD as extractor, w/o any additional 

Sayan
Responsive Resident
Responsive Resident

Hey @Andrey86 

 

Just need a confirmation that the Tables are present in a SQL server or Excel.

can your please share the sources of your data?

 

 

------------------------------------------------------------------------------------------------------------------------------

Thanks,

Sayan Patra | RPA Developer

Its easy to understand if I sent an example from PAD

Variables.CreateNewDatatable InputTable: { ^['БЕ', 'Кассовая книга', 'Основной счет', 'Начальное сальдо', 'Сумма прихода наличных', 'Сумма поступивших чеков', 'Сумма выдачи наличных', 'Остаток', 'из них наличные', 'СуммаGl', 'Разница'], [$'''KZ10''', $'''KZT1''', 240001000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT2''', 240002000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT3''', 240003000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT4''', 240004000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT5''', 240005000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT6''', 240006000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT7''', 240007000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT8''', 240008000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT9''', 240009000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ10''', 240010000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ11''', 240011000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ12''', 240012000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ13''', 240013000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ14''', 240014000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ15''', 240015000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ16''', 240016000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ17''', 240017000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ18''', 240018000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ19''', 240019000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ20''', 240020000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT1''', 240001000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT2''', 240002000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT3''', 240003000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT4''', 240004000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT5''', 240005000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT6''', 240006000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT7''', 240007000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT8''', 240008000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT9''', 240009000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ10''', 240010000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ11''', 240011000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ12''', 240012000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ13''', 240013000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ14''', 240014000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ15''', 240015000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ16''', 240016000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ17''', 240017000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ18''', 240018000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ19''', 240019000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ20''', 240020000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ21''', 240021000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ22''', 240022000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT1''', 240001000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT2''', 240002000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT3''', 240003000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT4''', 240004000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT5''', 240005000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT6''', 240006000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT7''', 240007000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT8''', 240008000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT9''', 240009000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ10''', 240010000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ11''', 240011000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ12''', 240012000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ13''', 240013000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ14''', 240014000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ15''', 240015000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ16''', 240016000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ17''', 240017000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ18''', 240018000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''] } DataTable=> DataTable
Clipboard.GetText Text=> ClipboardText
Text.SplitText.Split Text: ClipboardText StandardDelimiter: Text.StandardDelimiter.NewLine DelimiterTimes: 1 Result=> TextList
Variables.GenerateDataTableFromCSV.ReadCustomSeparator CSVText: TextList TrimFields: True FirstLineContainsColumnNames: False ReadFieldsAsText: False CustomColumnsSeparator: $'''|''' CSVTable=> CSVTable
Variables.DeleteColumnFromDataTable.DeleteColumnWithIndex DataTable: CSVTable ColumnIndex: 0
Variables.DeleteColumnFromDataTable.DeleteColumnWithIndex DataTable: CSVTable ColumnIndex: 3
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''* ''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''*KZ10''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''*KZ17''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''*KZ20''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''***''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''БЕ''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
SET Iter TO 0
LOOP FOREACH CurrentItem2 IN CSVTable
    IF IsEmpty(CurrentItem2[0]) THEN
        Variables.DeleteRowFromDataTable DataTable: CSVTable RowIndex: Iter
    ELSE
        Variables.IncreaseVariable Value: Iter IncrementValue: 1
    END
END

 

Entering data (just copy below to clipboard):

TOО "БЦК" Отд. позиции Гл. книги Дата 15.07.2024
Бухтарма Страни 1
-----------------------------------------
| БЕ |ГлавКнига | Сумма в ВВ|
-----------------------------------------
|* KZ10|240001000 | 8 378 509,45 |
|* KZ10|240002000 | 135 879,27 |
|* KZ10|240003000 | 13 726,20 |
|* KZ10|240004000 | 96 206,28 |
|* KZ10|240005000 | 0,00 |
|* KZ10|240007000 | 0,00 |
|* KZ10|240009000 | 0,00 |
|* KZ10|240010000 | 0,00 |
|* KZ10|240012000 | 502 960,27 |
|* KZ10|240013000 | 0,00 |
|* KZ10|240014000 | 0,00 |
|* KZ10|240016000 | 0,00 |
|* KZ10|240017000 | 199,00 |
|* KZ10|240018000 | 0,00 |
|* KZ10|240019000 | 0,00 |
|* KZ10|240020000 | 0,00 |
-----------------------------------------
|** KZ10| | 9 127 480,47 |
-----------------------------------------
|* KZ17|240001000 | 0,00 |
|* KZ17|240002000 | 325,00 |
|* KZ17|240003000 | 45 070,00 |
|* KZ17|240004000 | 560 640,00 |
|* KZ17|240005000 | 0,00 |
|* KZ17|240006000 | 0,00 |
|* KZ17|240007000 | 9 161,50 |
|* KZ17|240008000 | 950,00 |
|* KZ17|240009000 | 0,00 |
|* KZ17|240010000 | 209 500,00 |
|* KZ17|240011000 | 258 805,00 |
|* KZ17|240012000 | 0,00 |
|* KZ17|240013000 | 26 508,00 |
|* KZ17|240014000 | 0,00 |
|* KZ17|240015000 | 45 040,10 |
|* KZ17|240016000 | 0,00 |
|* KZ17|240017000 | 0,00 |
|* KZ17|240018000 | 0,00 |
|* KZ17|240019000 | 0,00 |
|* KZ17|240020000 | 1 482 675,00 |
|* KZ17|240021000 | 296 014,00 |
|* KZ17|240022000 | 1 372 655,00 |
-----------------------------------------
|** KZ17| | 4 307 343,60 |
-----------------------------------------
|* KZ20|240001000 | 0,00 |
|* KZ20|240003000 | 0,00 |
|* KZ20|240004000 | 135 879,70 |
|* KZ20|240005000 | 3 335,38 |
|* KZ20|240006000 | 64 900,19 |
|* KZ20|240007000 | 0,00 |
|* KZ20|240008000 | 109 776,00 |
|* KZ20|240009000 | 51 545,00 |
|* KZ20|240010000 | 0,00 |
|* KZ20|240011000 | 0,00 |
|* KZ20|240012000 | 0,00 |
|* KZ20|240013000 | 0,00 |
|* KZ20|240014000 | 979,20 |
|* KZ20|240015000 | 0,00 |
|* KZ20|240016000 | 51 375,00 |
|* KZ20|240017000 | 0,00 |
|* KZ20|240018000 | 0,00 |
-----------------------------------------
|** KZ20| | 417 790,47 |
-----------------------------------------
|*** | | 13 852 614,54 |
-----------------------------------------

Hi, it's easy to share a flow from PAD and source:

PAD script is

 

Variables.CreateNewDatatable InputTable: { ^['БЕ', 'Кассовая книга', 'Основной счет', 'Начальное сальдо', 'Сумма прихода наличных', 'Сумма поступивших чеков', 'Сумма выдачи наличных', 'Остаток', 'из них наличные', 'СуммаGl', 'Разница'], [$'''KZ10''', $'''KZT1''', 240001000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT2''', 240002000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT3''', 240003000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT4''', 240004000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT5''', 240005000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT6''', 240006000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT7''', 240007000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT8''', 240008000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT9''', 240009000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ10''', 240010000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ11''', 240011000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ12''', 240012000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ13''', 240013000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ14''', 240014000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ15''', 240015000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ16''', 240016000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ17''', 240017000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ18''', 240018000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ19''', 240019000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ20''', 240020000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT1''', 240001000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT2''', 240002000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT3''', 240003000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT4''', 240004000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT5''', 240005000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT6''', 240006000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT7''', 240007000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT8''', 240008000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT9''', 240009000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ10''', 240010000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ11''', 240011000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ12''', 240012000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ13''', 240013000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ14''', 240014000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ15''', 240015000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ16''', 240016000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ17''', 240017000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ18''', 240018000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ19''', 240019000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ20''', 240020000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ21''', 240021000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ22''', 240022000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT1''', 240001000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT2''', 240002000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT3''', 240003000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT4''', 240004000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT5''', 240005000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT6''', 240006000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT7''', 240007000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT8''', 240008000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT9''', 240009000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ10''', 240010000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ11''', 240011000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ12''', 240012000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ13''', 240013000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ14''', 240014000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ15''', 240015000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ16''', 240016000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ17''', 240017000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ18''', 240018000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''] } DataTable=> DataTable
Clipboard.GetText Text=> ClipboardText
Text.SplitText.Split Text: ClipboardText StandardDelimiter: Text.StandardDelimiter.NewLine DelimiterTimes: 1 Result=> TextList
Variables.GenerateDataTableFromCSV.ReadCustomSeparator CSVText: TextList TrimFields: True FirstLineContainsColumnNames: False ReadFieldsAsText: False CustomColumnsSeparator: $'''|''' CSVTable=> CSVTable
Variables.DeleteColumnFromDataTable.DeleteColumnWithIndex DataTable: CSVTable ColumnIndex: 0
Variables.DeleteColumnFromDataTable.DeleteColumnWithIndex DataTable: CSVTable ColumnIndex: 3
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''* ''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''*KZ10''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''*KZ17''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''*KZ20''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''***''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''БЕ''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
SET Iter TO 0
LOOP FOREACH CurrentItem2 IN CSVTable
    IF IsEmpty(CurrentItem2[0]) THEN
        Variables.DeleteRowFromDataTable DataTable: CSVTable RowIndex: Iter
    ELSE
        Variables.IncreaseVariable Value: Iter IncrementValue: 1
    END
END

 

 

Source is (copy to clipboard, this will be updated)

 

TOО "БЦК"                 Отд. позиции Гл. книги                Дата  15.07.2024
Бухтарма                                                        Страни         1
-----------------------------------------
|   БЕ  |ГлавКнига |          Сумма в ВВ|
-----------------------------------------
|*  KZ10|240001000 |       8 378 509,45 |
|*  KZ10|240002000 |         135 879,27 |
|*  KZ10|240003000 |          13 726,20 |
|*  KZ10|240004000 |          96 206,28 |
|*  KZ10|240005000 |               0,00 |
|*  KZ10|240007000 |               0,00 |
|*  KZ10|240009000 |               0,00 |
|*  KZ10|240010000 |               0,00 |
|*  KZ10|240012000 |         502 960,27 |
|*  KZ10|240013000 |               0,00 |
|*  KZ10|240014000 |               0,00 |
|*  KZ10|240016000 |               0,00 |
|*  KZ10|240017000 |             199,00 |
|*  KZ10|240018000 |               0,00 |
|*  KZ10|240019000 |               0,00 |
|*  KZ10|240020000 |               0,00 |
-----------------------------------------
|** KZ10|          |       9 127 480,47 |
-----------------------------------------
|*  KZ17|240001000 |               0,00 |
|*  KZ17|240002000 |             325,00 |
|*  KZ17|240003000 |          45 070,00 |
|*  KZ17|240004000 |         560 640,00 |
|*  KZ17|240005000 |               0,00 |
|*  KZ17|240006000 |               0,00 |
|*  KZ17|240007000 |           9 161,50 |
|*  KZ17|240008000 |             950,00 |
|*  KZ17|240009000 |               0,00 |
|*  KZ17|240010000 |         209 500,00 |
|*  KZ17|240011000 |         258 805,00 |
|*  KZ17|240012000 |               0,00 |
|*  KZ17|240013000 |          26 508,00 |
|*  KZ17|240014000 |               0,00 |
|*  KZ17|240015000 |          45 040,10 |
|*  KZ17|240016000 |               0,00 |
|*  KZ17|240017000 |               0,00 |
|*  KZ17|240018000 |               0,00 |
|*  KZ17|240019000 |               0,00 |
|*  KZ17|240020000 |       1 482 675,00 |
|*  KZ17|240021000 |         296 014,00 |
|*  KZ17|240022000 |       1 372 655,00 |
-----------------------------------------
|** KZ17|          |       4 307 343,60 |
-----------------------------------------
|*  KZ20|240001000 |               0,00 |
|*  KZ20|240003000 |               0,00 |
|*  KZ20|240004000 |         135 879,70 |
|*  KZ20|240005000 |           3 335,38 |
|*  KZ20|240006000 |          64 900,19 |
|*  KZ20|240007000 |               0,00 |
|*  KZ20|240008000 |         109 776,00 |
|*  KZ20|240009000 |          51 545,00 |
|*  KZ20|240010000 |               0,00 |
|*  KZ20|240011000 |               0,00 |
|*  KZ20|240012000 |               0,00 |
|*  KZ20|240013000 |               0,00 |
|*  KZ20|240014000 |             979,20 |
|*  KZ20|240015000 |               0,00 |
|*  KZ20|240016000 |          51 375,00 |
|*  KZ20|240017000 |               0,00 |
|*  KZ20|240018000 |               0,00 |
-----------------------------------------
|** KZ20|          |         417 790,47 |
-----------------------------------------
|***    |          |      13 852 614,54 |
-----------------------------------------

 

 

Hi

Source is text from clipboard:

TOО "БЦК" Отд. позиции Гл. книги Дата 15.07.2024
Бухтарма Страни 1
-----------------------------------------
| БЕ |ГлавКнига | Сумма в ВВ|
-----------------------------------------
|* KZ10|240001000 | 8 378 509,45 |
|* KZ10|240002000 | 135 879,27 |
|* KZ10|240003000 | 13 726,20 |
|* KZ10|240004000 | 96 206,28 |
|* KZ10|240005000 | 0,00 |
|* KZ10|240007000 | 0,00 |
|* KZ10|240009000 | 0,00 |
|* KZ10|240010000 | 0,00 |
|* KZ10|240012000 | 502 960,27 |
|* KZ10|240013000 | 0,00 |
|* KZ10|240014000 | 0,00 |
|* KZ10|240016000 | 0,00 |
|* KZ10|240017000 | 199,00 |
|* KZ10|240018000 | 0,00 |
|* KZ10|240019000 | 0,00 |
|* KZ10|240020000 | 0,00 |
-----------------------------------------
|** KZ10| | 9 127 480,47 |
-----------------------------------------
|* KZ17|240001000 | 0,00 |
|* KZ17|240002000 | 325,00 |
|* KZ17|240003000 | 45 070,00 |
|* KZ17|240004000 | 560 640,00 |
|* KZ17|240005000 | 0,00 |
|* KZ17|240006000 | 0,00 |
|* KZ17|240007000 | 9 161,50 |
|* KZ17|240008000 | 950,00 |
|* KZ17|240009000 | 0,00 |
|* KZ17|240010000 | 209 500,00 |
|* KZ17|240011000 | 258 805,00 |
|* KZ17|240012000 | 0,00 |
|* KZ17|240013000 | 26 508,00 |
|* KZ17|240014000 | 0,00 |
|* KZ17|240015000 | 45 040,10 |
|* KZ17|240016000 | 0,00 |
|* KZ17|240017000 | 0,00 |
|* KZ17|240018000 | 0,00 |
|* KZ17|240019000 | 0,00 |
|* KZ17|240020000 | 1 482 675,00 |
|* KZ17|240021000 | 296 014,00 |
|* KZ17|240022000 | 1 372 655,00 |
-----------------------------------------
|** KZ17| | 4 307 343,60 |
-----------------------------------------
|* KZ20|240001000 | 0,00 |
|* KZ20|240003000 | 0,00 |
|* KZ20|240004000 | 135 879,70 |
|* KZ20|240005000 | 3 335,38 |
|* KZ20|240006000 | 64 900,19 |
|* KZ20|240007000 | 0,00 |
|* KZ20|240008000 | 109 776,00 |
|* KZ20|240009000 | 51 545,00 |
|* KZ20|240010000 | 0,00 |
|* KZ20|240011000 | 0,00 |
|* KZ20|240012000 | 0,00 |
|* KZ20|240013000 | 0,00 |
|* KZ20|240014000 | 979,20 |
|* KZ20|240015000 | 0,00 |
|* KZ20|240016000 | 51 375,00 |
|* KZ20|240017000 | 0,00 |
|* KZ20|240018000 | 0,00 |
-----------------------------------------
|** KZ20| | 417 790,47 |
-----------------------------------------
|*** | | 13 852 614,54 |
-----------------------------------------

PAD flow:

Variables.CreateNewDatatable InputTable: { ^['БЕ', 'Кассовая книга', 'Основной счет', 'Начальное сальдо', 'Сумма прихода наличных', 'Сумма поступивших чеков', 'Сумма выдачи наличных', 'Остаток', 'из них наличные', 'СуммаGl', 'Разница'], [$'''KZ10''', $'''KZT1''', 240001000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT2''', 240002000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT3''', 240003000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT4''', 240004000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT5''', 240005000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT6''', 240006000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT7''', 240007000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT8''', 240008000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZT9''', 240009000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ10''', 240010000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ11''', 240011000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ12''', 240012000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ13''', 240013000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ14''', 240014000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ15''', 240015000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ16''', 240016000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ17''', 240017000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ18''', 240018000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ19''', 240019000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ10''', $'''KZ20''', 240020000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT1''', 240001000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT2''', 240002000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT3''', 240003000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT4''', 240004000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT5''', 240005000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT6''', 240006000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT7''', 240007000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT8''', 240008000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZT9''', 240009000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ10''', 240010000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ11''', 240011000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ12''', 240012000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ13''', 240013000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ14''', 240014000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ15''', 240015000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ16''', 240016000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ17''', 240017000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ18''', 240018000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ19''', 240019000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ20''', 240020000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ21''', 240021000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ17''', $'''KZ22''', 240022000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT1''', 240001000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT2''', 240002000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT3''', 240003000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT4''', 240004000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT5''', 240005000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT6''', 240006000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT7''', 240007000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT8''', 240008000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZT9''', 240009000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ10''', 240010000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ11''', 240011000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ12''', 240012000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ13''', 240013000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ14''', 240014000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ15''', 240015000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ16''', 240016000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ17''', 240017000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''], [$'''KZ20''', $'''KZ18''', 240018000, $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $'''''', $''''''] } DataTable=> DataTable
Clipboard.GetText Text=> ClipboardText
Text.SplitText.Split Text: ClipboardText StandardDelimiter: Text.StandardDelimiter.NewLine DelimiterTimes: 1 Result=> TextList
Variables.GenerateDataTableFromCSV.ReadCustomSeparator CSVText: TextList TrimFields: True FirstLineContainsColumnNames: False ReadFieldsAsText: False CustomColumnsSeparator: $'''|''' CSVTable=> CSVTable
Variables.DeleteColumnFromDataTable.DeleteColumnWithIndex DataTable: CSVTable ColumnIndex: 0
Variables.DeleteColumnFromDataTable.DeleteColumnWithIndex DataTable: CSVTable ColumnIndex: 3
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''* ''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''*KZ10''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''*KZ17''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''*KZ20''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''***''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableByColumnIndex DataTable: CSVTable AllMatches: True ValueToFind: $'''БЕ''' MatchCase: False MatchEntireCellContents: False TextToReplaceWith: $'''%''%''' ColumnNameOrIndex: 0
SET Iter TO 0
LOOP FOREACH CurrentItem2 IN CSVTable
IF IsEmpty(CurrentItem2[0]) THEN
Variables.DeleteRowFromDataTable DataTable: CSVTable RowIndex: Iter
ELSE
Variables.IncreaseVariable Value: Iter IncrementValue: 1
END
END

PAD flow and Source attached

Hey @Andrey86 

If you have Two DataTable have same number of rows please check the following solution Just modify the Column Names and the Index Number.

**REGION Set Variable
SET FirstCondition TO $'''False'''
SET SecondCondition TO $'''False'''
Variables.CreateNewDatatable InputTable: { ^['Column1', 'Column2', 'Column3'], [$'''KZ10''', 240001000, $''''''], [$'''KZ10''', 240002000, $''''''], [$'''KZ10''', 240003000, $''''''], [$'''KZ17''', 240001000, $''''''], [$'''KZ17''', 240002000, $''''''], [$'''KZ17''', 240003000, $''''''], [$'''KZ17''', 240004000, $''''''] } DataTable=> DataTable1
Variables.CreateNewDatatable InputTable: { ^['Column1', 'Column2', 'Column3'], [$'''KZ10''', 240001000, 837850945], [$'''KZ10''', 240002000, 12387925], [$'''KZ10''', 240003000, 78945], [$'''KZ17''', 240001000, 45678], [$'''KZ17''', 240002000, 12345], [$'''KZ17''', 240003000, 12345], [$'''KZ17''', 240004000, 75395] } DataTable=> DataTable2
SET RowCount TO DataTable1.RowsCount - 1
**ENDREGION
LOOP LoopIndex FROM 0 TO RowCount STEP 1
SET IndexNumber TO 0
IF DataTable1[LoopIndex][0] = DataTable2[LoopIndex][0] THEN
SET FirstCondition TO $'''True'''
END
IF DataTable1[LoopIndex][1] = DataTable2[LoopIndex][1] THEN
SET SecondCondition TO $'''True'''
END
IF FirstCondition = SecondCondition THEN
SET DataTable1[LoopIndex][2] TO DataTable2[LoopIndex][2]
SET FirstCondition TO $'''False'''
SET SecondCondition TO $'''False'''
END
Variables.IncreaseVariable Value: IndexNumber IncrementValue: 1
END

If you need anything, please reply.

 ------------------------------------------------------------------------------------------------------------------------------

If my suggestion helps you, please gives it a Thumbs up 👍 and Marks as a Solution ✔️. Which motivates to solve more problems.

Thanks,

Sayan Patra | RPA Developer

No, they have a different columns and rows count. And statments (rows in table2) can be moved and not stay at the same line

Hi @Andrey86 ,

 

If Both the Table Data is in the excel or if you can store them in excel .Please try the Vloopup with VBScript.

I have tested this Vbscript and its working.Please find the Vbscript.

Use the Run Vbscript action and paste the below code.

 

Vbscript Code:

Dim xlApp, xlInputWorkbook, xlOutputWorkbook, xlInputSheet, xlOutputSheet
Dim lastRowInput, lastRowOutput, i, j
Dim inputKeyA, inputKeyC, outputKeyA, outputKeyB, outputValueC

' Create Excel application
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = False ' Set to True if you want to see the Excel windows

' Open the input and output workbooks
Set xlInputWorkbook = xlApp.Workbooks.Open("C:\Users\Desktop\Power Automate Desktop\Practice\Excel\Input1.xlsx") ' Replace with your input file path
Set xlOutputWorkbook = xlApp.Workbooks.Open("C:\Users\Desktop\Power Automate Desktop\Practice\Excel\Input2.xlsx") ' Replace with your output file path

' Assuming data is on the first sheet of both workbooks
Set xlInputSheet = xlInputWorkbook.Sheets(1)
Set xlOutputSheet = xlOutputWorkbook.Sheets(1)

' Find the last row with data in the input and output sheets
lastRowInput = xlInputSheet.Cells(xlInputSheet.Rows.Count, "A").End(-4162).Row ' -4162 is xlUp
lastRowOutput = xlOutputSheet.Cells(xlOutputSheet.Rows.Count, "A").End(-4162).Row

' Loop through the rows of the input sheet
For i = 2 To lastRowInput ' Start from 2 to skip header
    inputKeyA = xlInputSheet.Cells(i, 1).Value ' Column A
    inputKeyC = xlInputSheet.Cells(i, 3).Value ' Column C

    ' Loop through the rows of the output sheet
    For j = 2 To lastRowOutput ' Start from 2 to skip header
        outputKeyA = xlOutputSheet.Cells(j, 1).Value ' Column A
        outputKeyB = xlOutputSheet.Cells(j, 2).Value ' Column B
        outputValueC = xlOutputSheet.Cells(j, 3).Value ' Column C

        ' Check if both columns match
        If inputKeyA = outputKeyA And inputKeyC = outputKeyB Then
            ' Place the value from output column C into input column D
            xlInputSheet.Cells(i, 4).Value = outputValueC
            Exit For
        End If
    Next
Next

' Save and close the workbooks
xlInputWorkbook.Save
xlInputWorkbook.Close
xlOutputWorkbook.Close

' Quit Excel application
xlApp.Quit

' Clean up
Set xlInputSheet = Nothing
Set xlOutputSheet = Nothing
Set xlInputWorkbook = Nothing
Set xlOutputWorkbook = Nothing
Set xlApp = Nothing

 

(Note:- if you got your solution you can mark as solution and gives kudos)


Thanks & Regards

Vishnu Reddy

Hey @Andrey86 

Have you tried with previous code?

 

The image you have provided earlier in your first post there is on First Table 4 Columns are there and Second Table has 3 Columns with same Row.

As I am unable to read the Languages of the Header of the column that's why I have created Same Types of DataTable and prepared the solution.

 

Solution:

Copy and Paste the code:

**REGION Set Variable
SET FirstCondition TO $'''False'''
SET SecondCondition TO $'''False'''
Variables.CreateNewDatatable InputTable: { ^['Column1', 'Column2', 'Column3', 'Column4'], [$'''KZ10''', $'''KZT1''', 240001000, $''''''], [$'''KZ10''', $'''KZT2''', 240002000, $''''''], [$'''KZ10''', $'''KZT3''', 240003000, $''''''], [$'''KZ17''', $'''KZT1''', 240001000, $''''''], [$'''KZ17''', $'''KZT2''', 240002000, $''''''], [$'''KZ17''', $'''KZT3''', 240003000, $''''''], [$'''KZ17''', $'''KZT4''', 240004000, $''''''] } DataTable=> DataTable1
Variables.CreateNewDatatable InputTable: { ^['Column1', 'Column2', 'Column3'], [$'''KZ10''', 240001000, 837850945], [$'''KZ10''', 240002000, 12387925], [$'''KZ10''', 240003000, 78945], [$'''KZ17''', 240001000, 45678], [$'''KZ17''', 240002000, 12345], [$'''KZ17''', 240003000, 12345], [$'''KZ17''', 240004000, 75395] } DataTable=> DataTable2
SET RowCount TO DataTable1.RowsCount - 1
**ENDREGION
LOOP LoopIndex FROM 0 TO RowCount STEP 1
SET IndexNumber TO 0
IF DataTable1[LoopIndex][0] = DataTable2[LoopIndex][0] THEN
SET FirstCondition TO $'''True'''
END
IF DataTable1[LoopIndex][2] = DataTable2[LoopIndex][1] THEN
SET SecondCondition TO $'''True'''
END
IF FirstCondition = SecondCondition THEN
SET DataTable1[LoopIndex][3] TO DataTable2[LoopIndex][2]
SET FirstCondition TO $'''False'''
SET SecondCondition TO $'''False'''
END
Variables.IncreaseVariable Value: IndexNumber IncrementValue: 1
END

 

Hope Now it will work!.

 

 ------------------------------------------------------------------------------------------------------------------------------

If my suggestion helps you, please gives it a Thumbs up and Marks as a Solution. This motivates to solve more 

problems.

Thanks,

Sayan Patra | RPA Developer

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,401)