I have the following PQL Code and it is working. TABLE (COUNT( "AP_BSEG"."ZTERM" ),"AP_BSEG"."ZTERM");How am i able to get the Max value from it? So overall the expression should give me the name of the most frequent value in this table column
Best answer by eugene.em13
There are a few ways you can get the MAX value of the payment terms:
1-standard aggregation
MAX("AP_BSEG"."ZTERM")
2-PU aggregation
PU_MAX(
CONSTANT()
,"AP_BSEG"."ZTERM"
)
The answer to second question is a bit different
So overall the expression should give me the name of the most frequent value in this table column
To answer that I would create an OLAP with the following parameters
Dimension - "AP_BSEG"."ZTERM"
KPI - COUNT_TABLE("AP_BSEG")
This will produce a table with all available payment terms and number of invoice lines per each
IF you want this in a single KPI component, try this:
COUNT(
CASE WHEN "AP_BSEG"."ZTERM" = PU_MAX(CONSTANT() ,"AP_BSEG"."ZTERM")
THEN 1
ELSE NULL
END
)
This expression will return the number of record counts in AP_BSEG where the payment terms equal the biggest number in that table
Please upvote if this is helpful
Eugene
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.