hi, i'm stuck on the part in one of the workflow that I'm writing. this might be an easy one to solve. For each original record (column A) I need to pick an alternative record with highest number value. example, for cost center code AB7612 the solution will be LH6493 (I would need to have all three columns in the output). for cost center code AD8533 solution will be PG0857. All the alternative cost center codes are unique numbers
Cost Center Code / Department Id | altern cc Cost Center Code / Department Id | altern cc Count |
AB7612 | LH6493 | 27 |
AB7612 | DW8627 | 7 |
AD8533 | PG0857 | 7 |
AD8533 | TS743 | 5 |
AD8533 | JE463 | 1 |
AQ8166 | QG6352 | 3 |
AQ8166 | LT465 | 1 |
BN0392 | OF072 | 9 |
BN0392 | JT1218 | 8 |
BN0392 | TO5350 | 8 |
BN0392 | RQ5505 | 8 |
BN0392 | OS1327 | 6 |
BN0392 | KU2266 | 5 |
BN0392 | KD8326 | 5 |
BN0392 | WV6492 | 4 |
BN0392 | GD9203 | 3 |
BN0392 | KG3994 | 3 |
BN0392 | ZS5014 | 2 |
BN0392 | FT6225 | 2 |
BN0392 | KXD7223 | 2 |
BN0392 | JG815 | 2 |
BN0392 | OH184 | 1 |
BN0392 | JR6490 | 1 |
BN0392 | DG6491 | 1 |
BN0392 | GT4407 | 1 |
BN0392 | KY770 | 1 |
BN0392 | YXS4580 | 1 |
PT1882 | PKO5450 | 1 |
LH4629 | PG1390 | 128 |
LH4629 | KF4159 | 79 |
LH4629 | HGD3398 | 76 |
LH4629 | BCX885 | 74 |
LH4629 | JCC1337 | 53 |
LH4629 | JVFC0483 | 50 |
LH4629 | KGV6308 | 47 |
LH4629 | BCF72106 | 42 |
LH4629 | MV2180 | 41 |
LH4629 | JHG1882 | 37 |
LH4629 | SZD939 | 37 |
LH4629 | LK8180 | 35 |
LH4629 | KM8495 | 35 |
LH4629 | KBV4588 | 30 |
LH4629 | HC416 | 29 |
LH4629 | LCD521 | 29 |
LH4629 | JNGV6834 | 28 |
LH4629 | MN838 | 25 |
LH4629 | KHU2511 | 23 |
LH4629 | JGV1742 | 22 |
LH4629 | CKL5684 | 22 |
LH4629 | KHB6086 | 22 |
LH4629 | DFG5191 | 22 |
LH4629 | KLNH70 | 20 |
LH4629 | VJB3267 | 19 |
LH4629 | KJB4195 | 19 |
LH4629 | FDX8258 | 18 |
LH4629 | KLHY8878 | 18 |
LH4629 | KNJ35 | 18 |
LH4629 | SZ4397 | 18 |
LH4629 | HJB195 | 18 |
LH4629 | FD0453 | 18 |
LH4629 | JBH459 | 17 |
LH4629 | RD2866 | 17 |
LH4629 | BH5190 | 17 |
LH4629 | GCF20706 | 16 |
LH4629 | LJKN10917 | 16 |
LH4629 | GC317 | 16 |
LH4629 | CF417 | 16 |
LH4629 | UYG83 | 15 |
LH4629 | GFC321 | 15 |
LH4629 | KL2027 | 15 |
LH4629 | GCF1741 | 15 |
LH4629 | HGJN29 | 15 |
LH4629 | CG4700 | 14 |
LH4629 | CFY4198 | 13 |
LH4629 | NM8032 | 13 |
LH4629 | UYG6088 | 13 |
LH4629 | CFR5782 | 13 |
LH4629 | ZSD7616 | 12 |
LH4629 | LBH92061 | 12 |
LH4629 | FJXFG23 | 12 |
LH4629 | CJD890 | 12 |
LH4629 | CUK162 | 11 |
LH4629 | FXKJ424 | 11 |
LH4629 | JGC3492 | 11 |
LH4629 | HC1854 | 11 |
LH4629 | LCG7318 | 11 |
LH4629 | FXK890 | 11 |
LH4629 | GCHK4779 | 10 |
LH4629 | KCGX3563 | 10 |
LH4629 | XHVG1606 | 10 |
LH4629 | HC615 | 10 |
LH4629 | KFCX5261 | 10 |
LH4629 | FKX3120 | 9 |
LH4629 | CKF183 | 9 |
LH4629 | FJ057 | 9 |
LH4629 | FKXY312 | 9 |
LH4629 | CKX4603 | 9 |
LH4629 | KHCXF22694 | 9 |
LH4629 | KXF494 | 9 |
LH4629 | DSZ0773 | 2 |
LH4629 | FJCX51411 | 2 |
LH4629 | GCLK39 | 2 |
LH4629 | KXFY5784 | 2 |
LH4629 | KYR1369 | 1 |
UT2043 | CKJ8145 | 18 |
UT2043 | KIG5617 | 1 |
UT2043 | GC6015 | 1 |
UT2043 | JGC2448 | 1 |
WQ8459 | MFGX8059 | 12 |
WQ8459 | KHGX9459 | 11 |
WQ8459 | FA97448 | 11 |
WQ8459 | HGCXF2743 | 10 |
WQ8459 | GCGF3310 | 9 |
WQ8459 | MHCG7441 | 8 |
WQ8459 | NBCG452 | 8 |
WQ8459 | KHGFX61516 | 7 |
WQ8459 | ZSR3897 | 7 |
WQ8459 | ETHA8732 | 6 |
WQ8459 | HGFX6548 | 5 |
WQ8459 | GIUVH8060 | 5 |
WQ8459 | MHGF7465 | 4 |
WQ8459 | KFX7469 | 4 |
WQ8459 | KHC02064 | 3 |
WQ8459 | HNJV467 | 3 |
WQ8459 | XBNC6539 | 3 |
WQ8459 | JMNV4248 | 2 |
WQ8459 | BCGX82391 | 2 |
WQ8459 | JBCX7442 | 1 |
WQ8459 | JHGCD7141 | 1 |
WQ8459 | HCBH9715 | 1 |
WQ8459 | VF19717 | 1 |
WQ8459 | BNV9718 | 1 |
WQ8459 | JBHCG816 | 1 |
WQ8459 | BC7450 | 1 |
WQ8459 | NCDXG731 | 1 |
YR6020 | HVCX2543 | 2 |
YR6020 | BKX0291 | 1 |
Solved! Go to Solution.
@alexnajm has the simple answer in his example. Sort, then sample first record based on grouping the cost center code.
Thank you! This solved the example. I havent used sample function in my workflows previously and didnt think of it :)