Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

User Defined variable.

Hi ,

Is there a way to pass user defined values in qlikview script while loading or after loading.I am having the sql as below,Pls suggest how its possible in qlikview to implement the below logic.(@GCNO).User should be able to give the number to the report and report should display the result by taking the user defined number as input.

Select calendar_date, store_number, sequence_key, gc_buy_or_redeem, gc_card_number,
gc_amount, gc_balance, gc_pos_id, gc_auth_type, gc_store_trans_num,
gc_trans_timestamp, gc_trans_type, gc_activation_type from gift_card_fact f,
date_dim d, store_dim s
where f.date_key=d.date_key and
f.store_key=s.store_key and
gc_card_number in (@GCNo)

Thanks,

Swetha

8 Replies
Not applicable
Author

Hi Everyone,

Any help is appreciated.

Thanks

Not applicable
Author

So you want them to input a number, let's call it 54, and then the script only loads report with GCNO = 54? If so, try the following:

Set up an input box with a variable, we'll call it vScriptVar.

Now type 54 into the input box.

In the script, add the following below the table:

WHERE GCNo=$(vScriptVar);

So the user types in the report number, reloads, and that report is reloaded. I've never tested that before, but I did the same thing with this and it worked fine (vScriptVar was defined by an input box as descibed above).

LOAD * INLINE [
A,
$(vScriptVar)
];

Not applicable
Author

Hi Jones,

Thanks for the reply.

But the user should not reload ,everything needed to be preloaded while the script is executed and user just type in GCNO and the report should display the values accordingly.

And also I did not understand the below part:

LOAD * INLINE [
A,
$(vScriptVar)
];

Basically I have pass all the values of field GCNO to the variable port,thats my requirement.I mean it should be preloaded.

Thanks,

Swetha

Not applicable
Author

Then just make a list box (or an input box) for GCNO and let them type in the report they want.

If you are loading all of the reports anyway, then you don't need to pass anything to the script.

Imagine if the reports you are loading look like this:

[Account Number], [Balance],[GCNO]

If you add an input box for the field [GCNO] and they type in 54, every row with a GCNO of 54 is going to show and the other reports will not.

Edited to add details.

Not applicable
Author

This is assuming that GCNO is a field and if it isn't you'll just have to add it.

Not applicable
Author

Hi Jones,

yes adding a list box is a good idea,I have n't even thought abt and thiniking in a sophisticated way.Is there a way where the liat can be represented as drop down box in qlikview?

Thanks,

Swetha

Not applicable
Author

If you want a drop down instead of a list box you can use a search box and just click the little down arrow on the right.

Not applicable
Author

got it thanks.