Member since
08-10-2022
27
Posts
1
Kudos Received
2
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 3236 | 03-16-2023 02:57 AM | |
| 14147 | 08-29-2022 04:50 AM |
06-16-2023
10:07 AM
Moreover, how to assign multiple values when the case matches? EX: select *,
case when F3BARC_BarcodeSegnacollo = '${barcode}' then '${Shipment_Number},${Shipment_Date},${Document_Date}'
else
F3SPNU_NumSpedizione end as F3SPNU_NumSpedizione
F3SPNU_DataSpedizione end as F3SPNU_DataSpedizione
F3SPNU_NumDocumento end as F3SPNU_NumDocumento
from flowfile Many Thanks!
... View more
06-16-2023
09:41 AM
OK , i've found the problem. My query was: select *,
case when F3BARC_BarcodeSegnacollo = '${barcode}' then '${Shipment_Number}'
else F3SPNU_NumSpedizione end as F3SPNU_NumSpedizione
from flowfile But fields selection won't have field in else statement like this: select F3BARC_BarcodeSegnacollo,
case when F3BARC_BarcodeSegnacollo = '${barcode}' then '${Shipment_Number}'
else F3SPNU_NumSpedizione end as F3SPNU_NumSpedizione
from flowfile Is there any way to make a select *? I have lots of fields to select. Many Thanks
... View more
06-16-2023
06:44 AM
Well, i'm not sure this query is exactly what i'm searching for. Speaking in a human way this is what i need to do: Search the element with barcode=${barcode_attribute} and if found update corresponding "shipment_number" value with ${shipment_number_attribute}, otherwise leave it as it is. So this: [ {
"reference" : "PB",
"date" : "20230613",
"barcode" : "C337287V28490010",
"shipment_number" : ""
}, {
"reference" : "PB",
"date" : "20230613",
"barcode" : "C337287V28490011",
"shipment_number" : ""
}, {
"reference" : "PB",
"date" : "20230613",
"barcode" : "C337287V28490012",
"shipment_number" : ""
} ] would becomes as below: [ {
"reference" : "PB",
"date" : "20230613",
"barcode" : "C337287V28490010",
"shipment_number" : "0000023/SH"
}, {
"reference" : "PB",
"date" : "20230613",
"barcode" : "C337287V28490011",
"shipment_number" : ""
}, {
"reference" : "PB",
"date" : "20230613",
"barcode" : "C337287V28490012",
"shipment_number" : ""
} ] Trying your query seems that does not update shipment_number field. Hope this can explain better the need. Many Thanks
... View more
06-15-2023
01:31 PM
Sure I Kwon this....the question is how to add a where clause in Updare Record or QueryRecord . In QueryRecord I ve tried an Update statement with no luck. Will giving me always an error.
... View more
06-15-2023
01:29 PM
Barcode is an attribute coming from each fragment...different on any fragment.
... View more
06-14-2023
02:17 PM
Hi to all, hope someone can point me on the right direction. I have something like that: [ {
"reference" : "PB",
"date" : "20230613",
"barcode" : "C337287V28490010",
"shipment_number" : ""
}, {
"reference" : "PB",
"date" : "20230613",
"barcode" : "C337287V28490011",
"shipment_number" : ""
}, {
"reference" : "PB",
"date" : "20230613",
"barcode" : "C337287V28490012",
"shipment_number" : ""
} ] I need to update only a specific record with a met condition. Speaking on a SQL language it should be something like that: UPDATE FLOWFILE SET shipment_number = '${Shipment_Number_Attribute} ' WHERE barcode = '${Barcode_Attribute}' Unfortunately this statement in QueryRecord doesn't work, maybe UPDATE not supported? Moreover is there any way to achieve the same with UpdateRecord? Many thanks for any help. Appreciate.
... View more
Labels:
- Labels:
-
Apache NiFi
05-26-2023
12:13 AM
Hi Community, hope someone can help me to build this transform: My Input: {
"Orders": [{
"Headers": {
"UniqShipment": "0"
},
"Goods": [{
"GoodsTypeID": 3,
"GoodsTypeName": "ALTRI MOBILI LEGNO",
"GoodsDetails": [{
"Packs": 1
}, {
"Packs": 1
}, {
"Packs": 1
}]
}],
"References": [{
"TypeReference": "DT",
"ValueReference": "006611",
"DateReference": "2023-04-14"
}, {
"TypeReference": "CM",
"ValueReference": "JOHN"
}, {
"TypeReference": "OC",
"ValueReference": "V1250-0010"
}, {
"TypeReference": "RG",
"ValueReference": "TRCA_CATR726240_CA_006611_14_04_2023.json"
}]
}]
} My Desired Output: {
"header": {
"UniqShipment": "0"
},
"rows": {
"GoodsTypeName": ["ALTRI MOBILI LEGNO", "ALTRI MOBILI LEGNO", "ALTRI MOBILI LEGNO"],
"Packs": [1, 1, 1],
"ValueReference": ["V1250-0010", "V1250-0010", "V1250-0010"]
}
} My Transformation so far: [
{
"operation": "shift",
"spec": {
"Orders": {
"*": {
"Headers": "header",
"Goods": {
"*": {
"GoodsDetails": {
"*": {
"@(2,GoodsTypeName)": "rows.GoodsTypeName",
"Packs": "rows.Packs"
}
}
}
}
}
}
}
}
] Which Produce the following result: {
"header" : {
"UniqShipment" : "0"
},
"rows" : {
"GoodsTypeName" : [ "ALTRI MOBILI LEGNO", "ALTRI MOBILI LEGNO", "ALTRI MOBILI LEGNO" ],
"Packs" : [ 1, 1, 1 ]
} Now i need to make the last part: Based on the value of TypeReference which has to be "OC" then add the list of ValueReference per each element of "rows array" like this: {
"header": {
"UniqShipment": "0"
},
"rows": {
"GoodsTypeName": ["ALTRI MOBILI LEGNO", "ALTRI MOBILI LEGNO", "ALTRI MOBILI LEGNO"],
"Packs": [1, 1, 1],
"TypeReference": ["V1250-0010", "V1250-0010", "V1250-0010"]
}
} Many Thanks for your help, appreciate!
... View more
Labels:
- Labels:
-
Apache NiFi
04-19-2023
12:29 PM
Hello, with this topic i need a clue. I have a text based data, this is an example row: CA20230405112337BOL006057 20230405V1260 2023021000409I 311003000102504 CA20230405112337BOL006057 20230405V1260 2023021000509I 311003000102504 I need to convert to json but: 1 - i need to remove all spaces in between 2 - i need to separate fields with a separator in order to create a schema and make a conversion Example: CA;20230405;bla bla bla CA;20230405;bla bla bla How can i achieve this? Is there any other way to do that? Many Thabks
... View more
Labels:
- Labels:
-
Apache NiFi
03-16-2023
02:57 AM
This should work, in the past i've tried the same command with ExecuteProcess but it didn't accept upstream connections. Your solution is working great! Many thabks for your supporto.
... View more
03-16-2023
01:55 AM
Hi, tried your suggestion, however in that case this is the error:
... View more