cancel
Showing results for 
Search instead for 
Did you mean: 

Formatted Search in GRPO Rows to Display Remarks Based on Quality Result

Vishant26
Explorer
0 Kudos
201

In the GRPO document, I have the following user-defined fields (UDFs) at the row level:

  • QUALITYRESULT (Alphanumeric values are A and R): This field stores the quality result of each item. it is in Child table
  • REMARKS (Alphanumeric): This field stores remarks related to the item. It is in Child table
  • DisplayRemarks (Alphanumeric): This field is intended to display the remarks conditionally. It is in Parent table 

    what i want is for each row in child if I get Quality result  = 'R' then DisplayRemarks should display REMARKS
    but it should happend for each row.

    i used query 

    SELECT
    CASE
    WHEN $[$38.U_MKTR_QUALITYRESULT.0] = 'R' THEN $[$38.U_MKTR_REMARKS.0]
    ELSE NULL
    END AS Remarks
    FROM
    DUMMY


    and it is showing only for first row
View Entire Topic
MD1
Active Contributor
0 Kudos

Hi

Try this solution:

SELECT
STRING_AGG(T1.U_MKTR_REMARKS, '; ') AS DisplayRemarks
FROM
OPDN T0
INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry
WHERE
T1.U_MKTR_QUALITYRESULT = 'R'
AND T0.DocEntry = $[$8.DocEntry.0] 
GROUP BY
T0.DocEntry