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: 
Anonymous
Not applicable

help comparing fields in two columns using if statement

hey everyone, I am relatively new to the community. I have a question. I have a table shown below

I need a statement that will select the higher revenue if profit in Q1 and Q2 of id 1 are the same.

Thanks!

4 Replies
ogautier62
Specialist II
Specialist II

Hi,

use a sheet with dimension : id,quarter,profit

and max(revenue) as measure

regards

jyothish8807
Master II
Master II

Hi Titus,

Try this:

max(total <id,Proft>Revenue)

Capture.PNG

Br,

KC

Best Regards,
KC
raman_rastogi
Partner - Creator III
Partner - Creator III

Hi,

May be like this

Aggr( max( Revenue),id,Profit)

Anonymous
Not applicable
Author

thanks guys for the response, so this is the main table. Please dont mind the erased part, they are same number

as you can see different plants have different storage locations. I need another field that will serve as a flag to indicate the higher current stock if the storage locations are same but different plants.

I hope that makes sense. Please your response will be greatly appreciated.

Thanks!