Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

Default Selections: Macro

Hi all,

Can anyone share a sample application having a macro for default selection.

I want to apply this macro post relaod.

All my objects are in a particular state . Would that affect the macro?

Thanks

Khushboo

1 Solution

Accepted Solutions
Partner
Partner

Re: Default Selections: Macro

Check it out.

It works....

I corrected the syntax, now it is working fine.

Regards,

Patric

17 Replies
Partner
Partner

Re: Default Selections: Macro

Hi,

what you mean with all my objects are in a particular state. Would that affect the macro?

Regards,

Patric

Not applicable

Re: Default Selections: Macro

I am very much new to macro.

I mean say in a list box-product .i want to select default value as Product-A.

This list box is in a state -A?

can anyone help me with this macro.

Khushboo

Partner
Partner

Re: Default Selections: Macro

So you are using alternate states in your app?

You can try to to do something like that:

ActiveDocument.Fields("YourField", "State1").SelectValues("yourValueHere")

Cheers,

Patric

Not applicable

Re: Default Selections: Macro

so if i write this macro :

sub Default

ActiveDocument.Fields(".PGRP_LVL_1_DESC_TXT", "state-A").SelectValues("Product-A")

end sub

and on post reload ....apply this macro Default.

It should work ?

Thanks

Khushboo

Not applicable

Re: Default Selections: Macro

after reload i am redirected to that macro

MVP & Luminary
MVP & Luminary

Re: Default Selections: Macro

Does this macro work if you execute it from the modul-editor per click on Test-Button? What is the reason for these selection then normally a reload changed no former selection?

- Marcus

Not applicable

Re: Default Selections: Macro

when i test this macro.it gives type mismatch error?

Partner
Partner

Re: Default Selections: Macro

Check it out.

It works....

I corrected the syntax, now it is working fine.

Regards,

Patric

MVP & Luminary
MVP & Luminary

Re: Default Selections: Macro

If I have a closer look on your statement I notice the attempt to select this field within a certain state but the APIGuide didn't know such a parameter and I think it made no sense, too then a field is global and only sheets respectively sheet-objects could belong to a state. Further the syntax isn't quite correct then it must be:

ActiveDocument.Fields("MARKETSIZINGV1.PGRP_LVL_1_DESC_TXT", "Explore_OAMS").SelectValues("Prevnar Franchise")

- Marcus