Hello All,
I'm looking for assistance to convert the following functions in M Language.
For the 5 formula, please find the below table for reference.
I'm looking for assistance to convert the following functions in M Language.
- Ageing = IF([ReceiveDate]]=TODAY(),0,NETWORKDAYS([ReceiveDate]]+1,TODAY()))
- Age Group =
IF(AND([Ageing]>=0,[Ageing]<=5),"[0 - 5]",
IF(AND([Ageing]>=6,[Ageing]<=10),"[6-10]",
IF(AND([Ageing]>=11,[Ageing]<=20),"[11 - 20]",
IF(AND([Ageing]>=21,[Ageing]<=30),"[21 - 30]",
IF(AND([Ageing]>=31,[Ageing]<=60),"[ 31 - 60]",
IF(AND([Ageing]>=61,[Ageing]<=90),"[ 61 - 90]",
"[ > 90]")))))) - OrderWeek = [ReceiveDate]-WEEKDAY([ReceiveDate])+2
- CRD_Month = IF(OR(ISBLANK([CustomerReqDate]),[CustomerReqDate]<=TODAY()+31),"CRDD Current","CRDD Future")
- BlockCode =LET(x,TEXTSPLIT([UserStatus]," "),TEXTJOIN(" ",,XLOOKUP(x,UserStatusCode,UserStatusCode,"")))
For the 5 formula, please find the below table for reference.
SalesOrderNo | ProductNo | OrderQty | CompleteDelivery | UserStatus | BlockCode | UserStatusCode | ||
112935380 | 1NR73A-K1H | 1 | N | C2AP INC-VBAP-CEPOK INCO MDID NoMP REL | INCO | INCO | ||
113430548 | A1A30A-KGJ | 1 | N | BLCA C2AP EOL2 NoMP REL SCAL | EOL2 SCAL | EOL2 | ||
113493710 | 1NR73A-K1H | 1 | N | C2AP INC-VBAP-CEPOK INCO MDID NoMP REL | INCO | RRDC | ||
113512547 | A1A30A-KGJ | 1 | N | C2AP EOL2 NoMP REL SCAL | EOL2 SCAL | SCAL | ||
113543813 | 5RA32F-KGJ | 1 | N | C2AP MDID NoMP REL RRDC | RRDC | XBOP | ||
113561139 | A1A30A-KGJ | 1 | N | EOL2 MDID NoMP REL SCAL | EOL2 SCAL | |||
113705782 | A1A77A-KGJ | 10 | N | C2AP EOL2 MDID NoMP REL SCAL | EOL2 SCAL | |||
113725103 | N7L37A | 1 | N | C2AP INC-VBAP-CEPOK INCO MDID NoMP REL | INCO | |||
113900946 | 2Z600F-KGJ | 1 | N | C2AP NoMP REL SCAL | SCAL | |||
113933893 | 3JA05AN-150 | 1 | N | C2AP EOL2 NoMP REL | EOL2 | |||
113969730 | A1A56A-KGJ | 1 | N | C2AP EOL2 MDID NoMP REL SCAL | EOL2 SCAL | |||
113987750 | 5RA32F-KGJ | 1 | N | COM-GLA NoMP REL | ||||
114002150 | 2Z613F-KGJ | 2 | N | C2AP NoMP REL SCAL | SCAL | |||
114002150 | 5RA32F-KGJ | 1 | N | COM-GLA NoMP REL | ||||
114003452 | 2Z600F-KGJ | 5 | N | C2AP NoMP REL SCAL | SCAL | |||
114005180 | 2Z600F-KGJ | 1 | N | C2AP NoMP REL SCAL | SCAL | |||
114016353 | A1A77A-KGJ | 1 | N | C2AP EOL2 MDID NoMP REL SCAL | EOL2 SCAL | |||
110113433 | 3GZ25A-KGJ | 1 | Y | BLKD C2AP COM-GLA NoMP REL SCAL | SCAL | |||
110113433 | K5L35A | 1 | Y | BLKD C2AP CFSL COM-ATP COM-FDL COM-GLA NoMP REL RRDC | RRDC | |||
110113433 | 3GZ25A-KGJ | 1 | Y | BLKD C2AP COM-GLA NoMP REL SCAL | SCAL | |||
110113433 | K5L35A | 1 | Y | BLKD C2AP CFSL COM-ATP COM-FDL COM-GLA NoMP REL RRDC | RRDC | |||
110113433 | Y3D03A | 1 | Y | BLKD C2AP CFSL COM-ATP COM-FDL COM-GLA NoMP REL | ||||
110113433 | Z7C07A | 1 | Y | BLKD C2AP CFSL COM-ATP COM-FDL COM-GLA NoMP REL | ||||
110113433 | 3PZ35A-KGJ | 1 | Y | C2AP CFSL COM-FDL COM-GLA COM-PDD NoMP PREL REL XBOP | XBOP | |||
110113433 | D7P27A | 1 | Y | C2AP CFSL COM-FDL COM-GLA COM-PDD NoMP REL | ||||
110113433 | 3PZ35A-KGJ | 1 | Y | C2AP CFSL COM-FDL COM-GLA COM-PDD NoMP PREL REL XBOP | XBOP | |||
110113433 | D7P27A | 1 | Y | C2AP CFSL COM-FDL COM-GLA COM-PDD NoMP REL | ||||
110433907 | 3GZ25A-KGJ | 1 | Y | BLCA BLKD C2AP COM-GLA NoMP REL SCAL XBOP | SCAL XBOP | |||
110433907 | K5L35A | 1 | Y | BLCA BLKD C2AP CFSL COM-ATP COM-FDL COM-GLA NoMP REL | ||||
110433907 | Y3D03A | 1 | Y | BLCA BLKD C2AP CFSL COM-ATP COM-FDL COM-GLA NoMP REL | ||||
110433907 | Z7C07A | 1 | Y | BLCA BLKD C2AP CFSL COM-ATP COM-FDL COM-GLA NoMP REL | ||||
110433907 | 3GZ25A-KGJ | 1 | Y | BLCA BLKD C2AP COM-GLA NoMP REL SCAL XBOP | SCAL XBOP | |||