Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum for conditional use of formula in graph

Hi All,

I would like to sum values calculated by different formulas, which depends on the particular field value, somethink like:

if (LArt='LDUB15',0,
     
if(LEFT(LArt,4)='LDUB',sum(Price*Volume/1000),
          
sum(Volume*Price*100)))

See attached example QVW

if I use it in pivot table with more dimensions, it works fine BUT if I Use it in Graph with one Dimenson (Group), it uses only the last formula (sum(Volume*Price*100) ) for every row and kumulate it. I cant use additional dimension.

The right sum Value for dimension Group in Graph is 11 200,070 (NOT 18 200)

Does somebody has an idea how to sole it.

thanks a lot for your Idea(s)

Robert

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try this

=sum(if(LArt='LDUB15',0,          if(LEFT(LArt,4)='LDUB',Price*Volume/1000,                    Volume*Price*100)))

i.e. embedding the condition into the sum, not the sum into the condition.

View solution in original post

2 Replies
swuehl
MVP
MVP

Try this

=sum(if(LArt='LDUB15',0,          if(LEFT(LArt,4)='LDUB',Price*Volume/1000,                    Volume*Price*100)))

i.e. embedding the condition into the sum, not the sum into the condition.

Not applicable
Author

Hi Swuehl,

thanks for help.

I have tried to use this logic before, even more times, but allways got the "Error in expression". Originaly I have more IFs in expression then in my example, therfore migt be I have forgotten to delete something...

Thanks again.

Robert