Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Contributor

Text box pop-up on Year selection

Hi,

I am wanting to create a text box that pops up only when a certain Year field is selected. For instance, when any date in 2017 is selected I want the text box to pop-up "Data as of 2016". When any date in 2016 is selected I want the text box to pop-up saying "Data as of 2015", etc. Is there a way to do this in the Show Conditional area in the Layout tab?

Thanks.

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Text box pop-up on Year selection

Ah, ok, we need to put parentheses around the year calculation:

=If(Only(Year), 'Data as of ' & (Only(Year)-1) )

View solution in original post

8 Replies
Highlighted
MVP
MVP

Re: Text box pop-up on Year selection

Maybe create a show conditional in your text box like

=GetSelectedCount( DateField) >0

And as expression for the text box itself:

=If(Only(Year(DateField)), 'Data as of ' & Only(Year(DateField))-1)

Highlighted
Contributor

Re: Text box pop-up on Year selection

Thank you for your response.

So in the show conditional I put

=GetSelectedCount(Year) >0 ?

and on the General tab in the 'text' box I put

=If(Only(Year(Year)), 'Data as of ' & Only(Year(Year))-1)  or should I remove one of those Years? Either way I get "-" as my result. I'm also not very familiar with the Only function...

Highlighted
MVP
MVP

Re: Text box pop-up on Year selection

You don't need to apply Year() function to a year field, this is only useful to calculate year number from a date number field.

=If(Only(Year), 'Data as of ' & Only(Year)-1)

In which field do you make your selections in? And how do your field values look like?

Highlighted
Contributor

Re: Text box pop-up on Year selection

I have a list box for the 'Month' field and a separate list box for the 'Year' field.

Highlighted
MVP
MVP

Re: Text box pop-up on Year selection

If you make a single Year selection, does the text box work as expected?

Highlighted
Contributor

Re: Text box pop-up on Year selection

It does not. I am getting a - in the box

Highlighted
MVP
MVP

Re: Text box pop-up on Year selection

Ah, ok, we need to put parentheses around the year calculation:

=If(Only(Year), 'Data as of ' & (Only(Year)-1) )

View solution in original post

Highlighted
Contributor

Re: Text box pop-up on Year selection

Awesome, that worked. Thank you!