Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
geam1988
Creator
Creator

Problem in expression

Hallo,

Dimensions is VBAP.VBELN and VBAP.POSNR

$(vMEK) =

sum( aggr( sum( {$< KEPH.FLAG_KOSTENRELEVANT = {1} >} KEPH.MEK) / KEPH.LOSGR * sum(VBAP.KWMENG_EFF), VBAP.VBELN, VBAP.POSNR)) 

Expressions are,

MEK =

If (VBAK.AUART = 'ZSA3' OR 'ZSA4' , aggr (Sum (TOTAL.COSS)+ SUM (TOTAL.COSP) , AUFK.AUART , AUFK.KDAUF) , Sum ({< KONV.KSCHL = {'VPRS'} >} (KONV.KWERT))+ $(vMEK)


MGK - Zuschlag =

Sum( {< KONV.KSCHL = {'VPRS'} >} KONV.KWERT ) *0.122

3rd expression is    [MEK] + [MGK - Zuschlag]    

but it is giving wrong data. value from 2nd expression is not there.   what should i do ?


if i click expression total, it shows

if i click Sum of Rows, it shows


1 Solution

Accepted Solutions
prieper
Master II
Master II

might be a spelling issue?

Did you try to repeat simply the columns, i.e.

create one expression only with [MEK] and one with [MGK - Zuschlag].

Else, if one of the expression may result in NULL and is only formatted as 0, you may try

NUMSUM([MEK], [MGK - Zuschlag])

Peter

View solution in original post

5 Replies
prieper
Master II
Master II

What is the purpose of the AGGR-function in Expression for MEK?

Think that this expression should be preceded by SUM, else this expression may deliver multiple results, which QV cannot handle.

Peter

geam1988
Creator
Creator
Author

i just wanted to show the sum as per AUFK.AUART.  AUFK table and VBAP table are connected. AUFK table are connected with COSS and COSP table. So far MEK is still working properly. but i am having problem in 3rd expression     (          [MEK] + [MGK - Zuschlag]                   )

Do you think that is the problem ?

prieper
Master II
Master II

might be a spelling issue?

Did you try to repeat simply the columns, i.e.

create one expression only with [MEK] and one with [MGK - Zuschlag].

Else, if one of the expression may result in NULL and is only formatted as 0, you may try

NUMSUM([MEK], [MGK - Zuschlag])

Peter

geam1988
Creator
Creator
Author

If i do not use  AGGR . it shows MEK like this.

prieper
Master II
Master II

so there is something not correct with the formula.

Suggest to cut the formula into pieces and check, which one is correct and then compose again together.

Peter