Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Expression help

Hi,

I have the following expression and I would like to include where the hdr_num is DISTINCT.  Is this possible?

Thanks,

Daniel

 

Fabs(sum(if(trade_type_name='APO' and opt_pc_name='Put',(opt_strike_price)*payment_qty, if(trade_type_name='APO' and opt_pc_name='Call',(-opt_strike_price)*payment_qty))))

 

 

 

 

13 Replies
tamilarasu
Champion
Champion

Daniel

You can try below expression,

If(opt_pc_name = 'Put', Sum(Aggr(sum(DISTINCT{<opt_pc_name={`Put`}>}opt_strike_price*payment_qty),hdr_num)),

Sum(Aggr(sum(DISTINCT{<opt_pc_name={`Call`}>}opt_strike_price*-payment_qty),hdr_num)) )

Anil_Babu_Samineni

Hi,

It depends what you want to achive by combining. If you need an arthemetic operation between Set 1 and 2 then can directly join them. If you want set 1 and set 2 to made for union/intersection or any other "set theory" operations, QV support them thru set analysis operators. You can read about them more in QV help (Section "Set Operators" in "set analysis")

Might be helpful meantime try with 2 variables and let me know.

- Anil

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
danielnevitt
Creator
Creator
Author

Hi Tamil,

That expression seems to work.  Thanks for your help.

Regards,

Daniel

tamilarasu
Champion
Champion

No Problem. Have a nice day.