Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
martinr_
Creator
Creator

Sum intersection

 
Hello.

I have a question about the constraint on sums.
These query give me a result in SQL.

select sum(sales) from test where belegtyp='AB' and geschaeftsjahr=kdatum_geschaeftsjahr
What must it look like in QLIK? I always get 0. Sum(TOTAL{<BELEGTYP={'AB'},GESCHAEFTSJAHR={"KDATUM_GESCHAEFTSJAHR"}>}SALES)
Thanks for your help.
1 Solution

Accepted Solutions
martinr_
Creator
Creator
Author

Thank you - is working 🙂

Nice Weekend !!!!

View solution in original post

9 Replies
Somasundaram
Creator III
Creator III

Try with this,

 

Sum({<BELEGTYP={'AB'},GESCHAEFTSJAHR={'KDATUM_GESCHAEFTSJAHR'}>}SALES)

 


-Somasundaram

If this resolves your Query please like and accept this as an answer.
martinr_
Creator
Creator
Author

Hi,

I tried this, but both provide 0

Sum ({<BELEGTYP = { 'AB'}, GESCHAEFTSJAHR = { 'KDATUM_GESCHAEFTSJAHR'}>} SALES)
Sum ({<BELEGTYP = { 'AB'}, GESCHAEFTSJAHR = { "KDATUM_GESCHAEFTSJAHR"}>} SALES)
Somasundaram
Creator III
Creator III

If possible can you share the qlik file?

 


-Somasundaram

If this resolves your Query please like and accept this as an answer.
sunny_talwar

May be you want kdatum_geschaeftsjahr to be in lower case

Sum({<BELEGTYP = {'AB'}, GESCHAEFTSJAHR ={"kdatum_geschaeftsjahr"}>} SALES)
sunny_talwar

Is kdatum_geschaeftsjahr another field or is that the value with GESCHAEFTSJAHR field?
martinr_
Creator
Creator
Author

result is 0.

table see pic

sunny_talwar

Try this

Sum({<BELEGTYP = {'AB'}>} If(GESCHAEFTSJAHR = KDATUM_GESCHAEFTSJAHR, SALES))
martinr_
Creator
Creator
Author

Thank you - is working 🙂

Nice Weekend !!!!

sunny_talwar

Super 🙂