Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
alvinford
Contributor III
Contributor III

Msg Box Display...

Hi Friends,

I have a simple requirement ...

How to use len function in Macro...

if the Len of ItemNo = 0 I have to display a message that "You have Items with No.Name".

How to achieve this ....

Regards,

Alvin...

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Ok!

You probably don't need a macro for that.

On the chart properties -> general tab. you can include a calculation condition like this:

=if( count(distinct ItemNo)=1,1,0)

Then, you include an error message to tell the user he should select something.

(on the same properties tab, click on error messages and include something at calculation condition unfulfilled)

Or you can include the same expression on the layout tab -> show conditional -> to hide the chart completely.

Hope it helps,

Erich

View solution in original post

6 Replies
erichshiino
Partner - Master
Partner - Master

It depends on what is ItemNo.... How do you want to trigger it?

A general syntax would be like this

sub Message

if( len(ItemNo)=0) then

     msgbox "You have items with No. Name"

end if

end sub

alvinford
Contributor III
Contributor III
Author

Hi Erich,

Thanks for Your Reply ..

Sorry  I am not clear on my requirement in the above post .

I have a Graph.. User can see it by clicking on the button. But before clicking on the button the User should select the ItemNo. If the User Clicks on the button with out selecting the Item No. A Message should POP up that "Please select the Item No". If the User Selects the ItemNo and Clicks on the button the message should not display .

This is my requirement

Regards,

Alvin.

erichshiino
Partner - Master
Partner - Master

Ok!

You probably don't need a macro for that.

On the chart properties -> general tab. you can include a calculation condition like this:

=if( count(distinct ItemNo)=1,1,0)

Then, you include an error message to tell the user he should select something.

(on the same properties tab, click on error messages and include something at calculation condition unfulfilled)

Or you can include the same expression on the layout tab -> show conditional -> to hide the chart completely.

Hope it helps,

Erich

Not applicable

Yes, Erich approch is the best solution still i have tried achieving your scenario with out macro using variables but need too many variables and buttons.

Check this atatched app and my suggestion for you is follow Erich approch.

- Sridhar

alvinford
Contributor III
Contributor III
Author

Hi Erich,

Thanks for your reply.Its works fine...

Regards,

Alvin.

alvinford
Contributor III
Contributor III
Author

Hi Sridar Thanx  for your application.

Regards,

Alvin.