Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
t_hylander
Creator
Creator

sum two max values

Hi,

Im totally blank at the moment...and you are so often Quick

I've got a table;

year_month, Unit, Data

2018_01, Unit1, 251

2018_01, Unit2, 718

2018_02, Unit1, 257

2018_02, Unit2, 865

..and so forth

The Data-column is cummulative and what I want is to add these two into one in a simle text-object.

I tried like this, but it wont work;

max({<Unit={'Unit1'}>}Data) + max({<Unit={'Unit2'}>}Data)

Thanks in advance!

1 Solution

Accepted Solutions
chrismarlow
Specialist II
Specialist II

Maybe ='Total ' & ( max({<Unit={'Unit1'}>}Data) + max({<Unit={'Unit2'}>}Data))?

View solution in original post

4 Replies
sunny_talwar

You are looking to get 257 + 865 in a text box object?

chrismarlow
Specialist II
Specialist II

Hi Tomas,

When you say not working, how do you mean? With your 4 lines as a dummy set I get 1122 in text box (does need an equals sign …), which does seem reasonable.

Cheers,

Chris.

t_hylander
Creator
Creator
Author

Ok, my bad...as I said my head was blank

It DOES work, however if I add a text infront it just gets blank.

='Total ' & chr(13) &

max({<Unit={'Unit1'}>}Data) + max({<Unit={'Unit2'}>}Data)

chrismarlow
Specialist II
Specialist II

Maybe ='Total ' & ( max({<Unit={'Unit1'}>}Data) + max({<Unit={'Unit2'}>}Data))?