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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If Statement Issue

Hi All,

I am trying to implement a Conditional statement based on the following criteria..

I have a list box called Technology. Each technology can be either a Product_Type WRT or TTL. So depending on the technology selected it will be either WRT or TTL. I have some rows in a table that I want to appear depending on whether the technology is WRT or TTL.

I tried using =GetFieldSelections(Product_Type) = 'WRT'

as the conditional experssion  - however this does not work unless I display the Produt_Type list box and actively select 'WRT', which I don't want the user to have to do. How can I test which product type group a  technology is in to enable the condition?

Many Thanks

John

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

IF(ISNULL(Only(Product_Type)), condition1, condition2)

View solution in original post

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try: aggr(only({<Product_Type={'WRT'}>} Technology), Technology)

or: if(Product_Type='WRT',Technology)


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

IF(ISNULL(Only(Product_Type)), condition1, condition2)

Not applicable
Author

  Hi Michael

I modified yoiur suggestion as follows and it works perfectly

Only (Product_Type)= 'IIC'

Not applicable
Author

Hi Gysbert,

Thanks for your suggestion, while I didn't use it in this instance, I did use it in a case where I wanted to show the list price in a table for the Current Forecast without requiring the user to select the Current Forecast..

 

aggr(only({<ForecastVersion={$(vCurrent_Forecast)}>} [List Price]), [List Price])

However, I don't fully understand how this works, and can't find a good explanation onlline.. Could I ask you to explain the Aggr(Only(... part of the expression please?

Thanks

john

arjunkrishnan
Partner - Creator II
Partner - Creator II

if(isnull(Only(Product_Type)), condition1, condition2)