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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

only


Hi,

What does it mean?

=

if(only({1} Type)='Current',green(),red())

Thanks

6 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If the only possible value of Type is the string 'Current' then apply the color green, otherwise apply the color red.


talk is cheap, supply exceeds demand
its_anandrjs
Champion III
Champion III

Hi,

Its means Only Type will be 'Current' and meaning of  {1} is no selection will effect the expression and when equation is true will display Green() otherwise Red().

Regards

Anand

Not applicable
Author

Hi,

Something seems to be incorrect with your expression :  if(only({1} Type)='Current',green(),red())

If it is used in the Color Expression, it will always return Red().

Only() -  acts as a aggr expression

{1} - It will return value (here,Type) irrespective of the selection.

You might get a better explaination If you may elaborate your query !

Cheers !

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi Amit,

Without enough details and explanation it is difficult to understand what you want to achieve.

However looking at your expression, i think you want to use the expression above and probably it isn't given you the result you desire.

= IF(ONLY({1} Type ='Current',green(),red()) should only work in chart BACKGROUND COLOR. But i don't see it working anywhere else. The use on 1 disregards selections.

If you can provide more details and explanations may be you might get more help.

Best Regards,

Gabriel

Not applicable
Author

Hi Gabreil,

Thanks for your quick explanation.

I got the use of this. \

I am using it for text color and purpose is when you select one value then other values should be also having text color

HTH

rubenmarin

Hi Amit,

The {1} ignores selection but not the dimension in graph, if "Type" is a dimension it says: If this value is for the Type 'Current' paint it green, in other case paint it red.