Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

If statement

I want to write an expression that sums the MLOA Total Days3 column for all instances where Placed Date1 >=5 and where DischargedDate2 >=1000.

If I do: if(Placed Date1>5 and DischargedDate2>=1000, sum(MLOA Total Days3). The only problem is that this way I would have to make selections under my PlacedDate1 and my DIschargedDate2 fields to get the graph to show me the data. I was wondering if there was a way where after I enter this script, the graph would automatically display the sum under these conditions, even if I hit the Clear button in QV.

Placed Date1Discharged Date2MLOA Total Days3
110012
220035
330098
440031
55007
66001
77002
88002
99000
1010002
1111002
12120024
1313000
1414001
1515002
1616000
1717000
1 Solution

Accepted Solutions
jsn
Honored Contributor

Re: If statement

instead of doing IF(CONDITION, SUM(FIELD)), try changing it to SUM(IF(CONDITION, FIELD))

2 Replies
jsn
Honored Contributor

Re: If statement

instead of doing IF(CONDITION, SUM(FIELD)), try changing it to SUM(IF(CONDITION, FIELD))

Not applicable

Re: If statement

The sum(if(condition,field)) worked! Thank you!

Community Browser