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

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
awalhashim
Contributor II
Contributor II

Count IF-Else statement

Hi,

i have a straight table consist of SaleID, Interest.BU, Booking.BU. Since both BU from Interest and Booking is many-to-many relationship so i added an expression and come out with correct BU.

if(Interest.BU = Booking.BU,count(SaleID),0)

Now i want to count the SaleID and InterestID in which in another expression but seems to fail to get the correct  no. it counting the whole id. i want the something like this.

Count(if Interest.BU = Booking.Bu)

which met the condition above. 

Labels (2)
1 Solution

Accepted Solutions
Thiago_Justen_
MVP
MVP

You could try it out:

Count({<"Interest.BU"= {"=Booking.BU"}>}SaleID)

Or

Count(If(Interest.BU = Booking.BU,SaleID))

Cheers
Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago

View solution in original post

3 Replies
Thiago_Justen_
MVP
MVP

You could try it out:

Count({<"Interest.BU"= {"=Booking.BU"}>}SaleID)

Or

Count(If(Interest.BU = Booking.BU,SaleID))

Cheers
Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
awalhashim
Contributor II
Contributor II
Author

Hi Thiago thanks for replying.

It doesn't work. Still return 0 when its counting.

Thiago_Justen_
MVP
MVP

Could you please share a mockup?
Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago