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: 
vespab24
Contributor II
Contributor II

SUM sales if 2 conditions exist

Hello,

I'm attempting to show records where 2017 sales <=0 AND 2016 sales >=0. The data doesn't match up to what I can see when doing the same in excel. I'm sure there is a better way to write this (super new to this). Appreciate any guidance.

My expression is as follows:

SUM(

{<

[Consolidated Partner Name]  ={"=IF(SUM({<[Year]={2017}>}[Sales USD])<=0,IF(SUM({<[Year]={2016}>}[Sales USD])>=0.01,[Sales USD]))"}

    >}

    [Sales USD])

1 Solution

Accepted Solutions
sunny_talwar

Try this

Sum({<[Consolidated Partner Name]  = {"=Sum({<[Year] = {2017}>} [Sales USD]) <= 0 and Sum({<[Year] = {2016}>} [Sales USD]) >= 0.01"}>} [Sales USD])

View solution in original post

6 Replies
sunny_talwar

Try this

Sum({<[Consolidated Partner Name]  = {"=Sum({<[Year] = {2017}>} [Sales USD]) <= 0 and Sum({<[Year] = {2016}>} [Sales USD]) >= 0.01"}>} [Sales USD])

dwforest
Specialist II
Specialist II

Possibly a simple if statement?

If(Sum({<[Year] = {2017}>} [Sales USD]) <= 0 and Sum({<[Year] = {2016}>} [Sales USD]) >= 0.01, Sum([Sales USD]))

sunny_talwar

Is that something you are asking me David or suggesting to Bradley? You responded to my response... so was not sure

dwforest
Specialist II
Specialist II

Sorry, meant as a suggestion to Bradley

sunny_talwar

No sorry needed, just wanted to make sure that I respond if it is a question for me

vespab24
Contributor II
Contributor II
Author

This worked perfect! I knew it was something simple and thought I tried this as well. I'm sure I had something very small in the incorrect place.