Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

IF condition question

Hi All,

I have a sales person table in that i have 5 persons. I want to find the revenue for 2 sales persons and revenue for the rest.

In the If condition how can i check. Is this like this?

IF(Sale_person = ('A' and 'B'), Revenue, Revenue)

-Raghu.

4 Replies
Not applicable
Author

If(Sale_person = 'A' Or Sale_person = 'B',Revenue,Revenue)

I guest you incase of A and B you want the revenue to be summed up, ..if so u need to Edit the dimension

If(Sale_person = 'B','A',Sale_person)

and expression will be Revenue only without any if condition.

Not applicable
Author

Hi Raghu,

if u want to sum of A and B Revenue togather and Sum of other 3 togather then you can do like this

Sum(IF(Sale_person='A' or Sale_person='B' ,Revenue,Revenue)

but i want to know against which dimention you want to show this Sum i.e(in the Script or in the chart)

Hope this will help you

prieper
Master II
Master II

In the Dimension you should enter

IF(Sale_Person = 'A' OR Sale_Person = 'B', Sale_Person, 'others')

The expression then should be SUM(Revenue).

if you wish to see just the revenue of the two person, the expression you should enter as

SUM(IF(Sale_Person = 'A' OR Sale_Person = 'B',Revenue))

Dimension then can be left blank, or has Sale_person ...

HTH
Peter

Not applicable
Author

Thanks Guys for your suggestions.

Peter -- I cannot restrict in the dimension, because i have combine A & B only and for other i have to show their revenues. It would be better to give in the expression only.

-Raghu.