Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Display Message when no data is selected (YTD)

Hi all,

I have a table with an YTD (year to date) expression. This works greate.

But I want to show a message if no date is slected, because in this case the table is empty.

At the moment i use this for calculating my ytd:

sum({<Year = {$(=only(Year))}, Month = {"<=$(=max(Month))"}>} AmountofOrder)

If no date is selected it looks like this:

2015-08-19_14h43_01.png

In this Case I want to display the Message "Please select a Year and Month"

2015-08-19_14h47_37.png

How could I do that?

Many Thanks for your efforts.

Philipp

1 Solution

Accepted Solutions
MVP
MVP

Re: Display Message when no data is selected (YTD)

Go to the Properties | General tab and enter an expression into the conditional calculation box. Something like:

GetSelectedCount(Year) > 0 And GetSelectedCount(Month) > 0

This will cause a Calculation condition unfulfilled error to appear if there is no Year or no Month (or neither) selected.  Change this error message to a more relevant one by clicking Error Messages, select Calculation condition unfulfilled and type your desired error messge.

If Year and Month are not the correct field names, change the expression above to the correct field names.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
7 Replies
Not applicable

Re: Display Message when no data is selected (YTD)

Go to chart general tab then write conditional expression and write the error message what you want

MVP
MVP

Re: Display Message when no data is selected (YTD)

Go to the Properties | General tab and enter an expression into the conditional calculation box. Something like:

GetSelectedCount(Year) > 0 And GetSelectedCount(Month) > 0

This will cause a Calculation condition unfulfilled error to appear if there is no Year or no Month (or neither) selected.  Change this error message to a more relevant one by clicking Error Messages, select Calculation condition unfulfilled and type your desired error messge.

If Year and Month are not the correct field names, change the expression above to the correct field names.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: Display Message when no data is selected (YTD)

Ok I understand,

but what is the condition for that, and where and how can I do that... can you please give me more details?!

hrlinder
Honored Contributor

Re: Display Message when no data is selected (YTD)

define in calculation condition like

=if((GetSelectedCount(yourryearfield) > 0) AND (GetSelectedCount(yourmonthfield) > 0),-1,0)

and Change error message  for "calcualation condition unfilled" to "Please select a Year and a Month)

Not applicable

Re: Display Message when no data is selected (YTD)

Thank you for the help, but but somehow I do not understand it complete.

This is what I have done:

2015-08-19_15h08_59.png

Then I wrote this:

2015-08-19_15h09_13.png

The name of the Fields is correct, but I do not know what you mean with

Go to the Properties | General tab and enter an expression into the conditional calculation box. Something like:

This will cause a Calculation condition unfulfilled error to appear if there is no Year or no Month (or neither) selected.  Change this error message to a more relevant one by clicking Error Messages, select Calculation condition unfulfilled and type your desired error messge.

Not applicable

Re: Display Message when no data is selected (YTD)

My Mistake...

But finally I found it.

Thank you so much!!

2015-08-19_15h30_01.png

MVP
MVP

Re: Display Message when no data is selected (YTD)

Your earlier post refers:

No, that expression must be entered in the 'Calculation Condition' box from your first screen shot.

Then enter the message that should appear when the condition is not me in the box in the second screen shot. But select the "Calculation condition unfulfilled" standard message before entering your custom message.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Community Browser