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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
clovati
Partner - Creator
Partner - Creator

Bring value from one or another column and then sum the exact values

RegionCol1Col2Col3
REGION1100200100
REGION21005050
   TOTAL (sum)200250150

Hi all.

Col3 >>>> if Col1<=Col2 then Col1 else Col2

How can I have the TOTAL (SUM) in Col3 = 150?

By default IF is applied also to totals and then I obtain 200 as Total in col3.

Thank you ALL

13 Replies
arulsettu
Master III
Master III

Capture.JPG

is this you want

antoniotiman
Master III
Master III

Hi Cristina,

try

Sum(Aggr(RangeMin(Col1,Col2),Region))

Regards,

Antonio

arulsettu
Master III
Master III

if yes write expression like this

if(Column(1)<Column(2),Column(1),Column(2))

and change the total mode

Capture.JPG

clovati
Partner - Creator
Partner - Creator
Author

It's a pivot and TOTAL MODE are disabled

clovati
Partner - Creator
Partner - Creator
Author

Region is in drill ... how can I do it when I drill down ?

thx

MK_QSL
MVP
MVP

Considering your expression as below

Column1 = SUM(Sales1)

Column2 = SUM(Sales2)

You can write as below

SUM(Aggr(IF(SUM(Sales1) <= SUM(Sales2), SUM(Sales1), SUM(Sales2)),Region))

arulsettu
Master III
Master III

what other fields are in the drill down. can you post sample data

Anil_Babu_Samineni

I am sorry if i miss something to read. Please use SUM for over expression if it is in Pivot

Sum(If(Col1<Col2, Col1, Col2))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
MK_QSL
MVP
MVP

For Drill down group use as below

SUM(Aggr(IF(SUM(Sales1) <= SUM(Sales2), SUM(Sales1), SUM(Sales2)),$(=GetCurrentField([New Group]))))

Where [New Group] is your drill down group name