Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
robertsb41
Contributor III
Contributor III

If Statement with multiple conditions

I am trying to create a calculated field based on multiple columns Contract ID, Bid Rank, and Amount.  If Bid Rank = 2 then I want Amount displayed for each row of the Contract ID.

This displays the amount but only for the row where bid rank =2, If([Bid Rank]=2, Amount).

So what I am getting is:

Contract IDBid RankAmountLow
271250-
272350350
273450-
62110-
6222020
62330-
62440-
731100-
732450450

 

What I want is:

Contract IDBid RankAmountLow
271250350
272350350
273450350
6211020
6222020
6233020
6244020
731100450
732450450

 

1 Solution

Accepted Solutions
sunny_talwar

calculated field? Meaning calculated dimension? Try this for calculated dimension

Aggr(NODISTINCT
    Sum({<[Bid Rank] = {2}>} Amount)
, [Contract ID])

View solution in original post

12 Replies
sunny_talwar

Try this may be

Sum(TOTAL <[Contract ID]> {<[Bid Rank] = {2}>} Amount)
robertsb41
Contributor III
Contributor III
Author

Sum(TOTAL <[Contract ID]> {<[Bid Rank] = {2}>} Amount)

I get unrecognized symbol: {

sunny_talwar

Really? Can you try this

Sum({<[Bid Rank] = {2}>} TOTAL <[Contract ID]> Amount)

 

robertsb41
Contributor III
Contributor III
Author

Sum({<[Bid Rank] = {2}>} TOTAL <[Contract ID]> Amount)

I get unrecognized symbol: {

sunny_talwar

Can you share an image of where we can see this error message?

robertsb41
Contributor III
Contributor III
Author

robertsb41_0-1594902511880.png

 

sunny_talwar

What kind of object are you using this in? Is this a table in Qlik Sense?

robertsb41
Contributor III
Contributor III
Author

Your expression works in a straight table but not when adding a calculated field.  Not sure how that makes sense.

robertsb41
Contributor III
Contributor III
Author

Yes, just a simple table.  There are multiple rows with the same [contract id] that are ordered by [bid rank] 1-n with different [amounts].