Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

alvinford
Not applicable

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
erich_shiino
Not applicable

Msg Box Display...

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

6 Replies
erich_shiino
Not applicable

Msg Box Display...

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
Not applicable

Msg Box Display...

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.

erich_shiino
Not applicable

Msg Box Display...

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

Re: Msg Box Display...

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
Not applicable

Msg Box Display...

Hi Erich,

Thanks for your reply.Its works fine...

Regards,

Alvin.

alvinford
Not applicable

Msg Box Display...

Hi Sridar Thanx  for your application.

Regards,

Alvin.