Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
newbie_sm
Contributor III
Contributor III

If condition

I have a "IF" condition formula for measure "MTH-REV [US$]" set as:

if(Customer='A' OR Customer='B', 'US$43,000', (Sum({$<Month={"=$(=Max([Month]))"}, Customer=-{'A','B'}>} Revenue)))

 

In the "Table" chart , the "Total" amount is not adding the revenue total including the revenue for Customers 'A' and 'B'

Customer MTH-REV [US$]
Total US$57,086
A US$43,000
B US$43,000
D US$27,632
E US$10,344
C US$9,610
F US$7,927
G US$1,574

 

how should I correct the formula in order to correctly reflect the "Total" amount in the chart?

Labels (2)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

as below

 

=Sum( Aggr( if(wildmatch(Customer,'A','B'), 43000,Sum({$<Month={"=$(=Max([Month]))"}, Customer=-{'A','B'}>} Revenue) ) , Customer ) )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

3 Replies
G3S
Creator III
Creator III

based on the expression looks like for A or B it is adding it as a text plus it is also removing customers A & B .

try 

if(Customer='A' OR Customer='B', 43000, (Sum({$<Month={"=$(=Max([Month]))"}>} Revenue)))

newbie_sm
Contributor III
Contributor III
Author

Thanks for the prompt response, but it didn't work.

The total is still showing without adding up the 43,000 x 2 for both customers 'A' and 'B'

vinieme12
Champion III
Champion III

as below

 

=Sum( Aggr( if(wildmatch(Customer,'A','B'), 43000,Sum({$<Month={"=$(=Max([Month]))"}, Customer=-{'A','B'}>} Revenue) ) , Customer ) )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.