Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bvssudhakar
Creator III
Creator III

Need help to write an expression in the combination of alternate state and set analysis

Hello Experts,

I need a help to write the Expression. I have  a Expression something like this

=if(USD_ASP<>0 and ProductType = 'Recommended',Count({Selection1*Selection3}Product_Product_Id)),Count({Selection2*Selection3}Product_Product_Id)))

But this is accepting USD_ASP's Zero values. Can you guys please check this query and help me out from this.

Selection1, Selection2, Selection3 are alternate states

2 Solutions

Accepted Solutions
hopkinsc
Partner - Specialist III
Partner - Specialist III

What about..

=if(ProductType = 'Recommended',
Count({Selection1*Selection3<USD_ASP={'>0'}>}Product_Product_Id),
Count({Selection2*Selection3<USD_ASP={'>0'}>}Product_Product_Id))

 

are there any USD_ASP <0?

View solution in original post

hopkinsc
Partner - Specialist III
Partner - Specialist III

you have 2 brackets in the first sum..

=if(ProductType = 'Recommended',Sum({{Selection1*Selection3<USD_ASP={">0"}>}USD_ASP),Sum({Selection2*Selection3<USD_ASP={">0"}>}USD_ASP))/
if(ProductType = 'Recommended',Count({Selection1*Selection3<USD_ASP={">0"}>}Product_Product_Id),Count({Selection2*Selection3<USD_ASP={">0"}>}Product_Product_Id))*ExchangeRate

 

remove 1 and see if that helps

View solution in original post

7 Replies
bvssudhakar
Creator III
Creator III
Author

@sunny_talwar@Frank_Hartmann

 

Can you guys Please have a look and help me out from this

 

 

Thank you in advance

hopkinsc
Partner - Specialist III
Partner - Specialist III

Hi, what is accepting zero values exactly, the else in the IF would accept zero values. 

What exactly do you want the IF statement to do?

 

bvssudhakar
Creator III
Creator III
Author

Hi,

I want to show the count (Product_product_Id) where USD_ASP <>0 by using alternate states

can you please modify that expression. 

hopkinsc
Partner - Specialist III
Partner - Specialist III

What about..

=if(ProductType = 'Recommended',
Count({Selection1*Selection3<USD_ASP={'>0'}>}Product_Product_Id),
Count({Selection2*Selection3<USD_ASP={'>0'}>}Product_Product_Id))

 

are there any USD_ASP <0?

bvssudhakar
Creator III
Creator III
Author

Hi @hopkinsc

It is some thing working, But my total expression is this. if write this expression it is showing error in expression

Can you please check for this once

=if(ProductType = 'Recommended',Sum({{Selection1*Selection3<USD_ASP={">0"}>}USD_ASP),Sum({Selection2*Selection3<USD_ASP={">0"}>}USD_ASP))/
if(ProductType = 'Recommended',Count({Selection1*Selection3<USD_ASP={">0"}>}Product_Product_Id),Count({Selection2*Selection3<USD_ASP={">0"}>}Product_Product_Id))*ExchangeRate

 

Thank you in advance

hopkinsc
Partner - Specialist III
Partner - Specialist III

you have 2 brackets in the first sum..

=if(ProductType = 'Recommended',Sum({{Selection1*Selection3<USD_ASP={">0"}>}USD_ASP),Sum({Selection2*Selection3<USD_ASP={">0"}>}USD_ASP))/
if(ProductType = 'Recommended',Count({Selection1*Selection3<USD_ASP={">0"}>}Product_Product_Id),Count({Selection2*Selection3<USD_ASP={">0"}>}Product_Product_Id))*ExchangeRate

 

remove 1 and see if that helps

bvssudhakar
Creator III
Creator III
Author

Hi @hopkinsc

Thank you very much for the solution. It's working NowSmiley Happy