Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

chrisgoudy
New Contributor II

text box over table that disappears when 2+ months are selected

I"m trying to make a text object over a table that will disappear once two or more months are selected

I have this in the text box on the General page of the properties

=if(count(DISTINCT Month) > 2, 'Please select two Months minimum', if(count(DISTINCT Month) = 1, 'Please select at least one more Month',)) &

chr(10) & chr(10) &

'You may have to clear selections prior to using these charts.'

and this on the Layout page show conditional

count(DISTINCT Month) <=2

7 Replies
MVP
MVP

text box over table that disappears when 2+ months are selected

If I understood correctly what you are trying to achieve, I would suggest that you are using the calculation condition of your chart instead of a text box.

Set the calculation condition on the general tab of your chart and customize the error message for not fulfilled condition using the dialog button on the same tab.

calculation condition:

=if(count(DISTINCT Month) <=2,0,1)

error message:

='Please select two Months minimum' & chr(10) & chr(10) &

'You may have to clear selections prior to using these charts.'

Hope this helps,

Stefan

chrisgoudy
New Contributor II

text box over table that disappears when 2+ months are selected

so this expression in the calcuation condition box on the general page of the chart ?

=if(count(DISTINCT Month) <=2,0,1) ='Please select two Months minimum' & chr(10) & chr(10) & 'You may have to clear selections prior to using these charts.'

the chart says calculation unfulfilled regardless of the amount of months selected

MVP
MVP

text box over table that disappears when 2+ months are selected

Well, only the first part goes into the calculation condition:

=if(count(DISTINCT Month) <=2,0,1)

If the condition is not fulfilled, you get a standard error message. You can customize this message in the dialog that you open by pressing the 'Error Messages...' button on the same tab.

chrisgoudy
New Contributor II

text box over table that disappears when 2+ months are selected

Ah, okay. I wasn't aware of the error message option. Thank you.

so it works fine if 3 or more months are selected, but the chart is showing when no months or when two months are selected.

I want the error message to come up when 0 or 1 month is selected only

MVP
MVP

Re: text box over table that disappears when 2+ months are selected

Hi

Try using GetSelectedCount('Month') in the condition rather than Count(DISTINCT Months). This will be zero if nothing is selected.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
chrisgoudy
New Contributor II

text box over table that disappears when 2+ months are selected

Jonathan

so would it be this expression ?

=if(GetSelectedCount('Month')) <=2,0,1

Luminary
Luminary

Re: text box over table that disappears when 2+ months are selected

Hi,

As mentioned by Jonathan and Stefan. You can use calculated condition as follows :

=GetSelectedCount([Month]) > 2

Assuming that you wanted to show the chart only if you have more than two selections on Month field. And you don't need additional IF conditional statement here because calculation condition in the chart returns the boolean value (-1 or 0) / (True or False). So you just need to give the condition and if it's true then the chart gets calculated and if it's false then the chart shows the custom error message.

I hope this makes it clear.

Cheers,

DV