Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

macro transform variable

Hello,

Can I transform this variable in a field? by API?

set v = ActiveDocument.Variables("gg")
v.SetContent "4" , true

Thanks

Best Regards

Slash [:)]

8 Replies
Not applicable
Author

I'm not sure what you're asking, it appears to me like you have the code there already, what is it that you cannot do?

Not applicable
Author

The code I posted works .

In the code I posted I wont to convert the variable I create to a field bot from SQL but From VB script.

Thanks

bestrgrds,

Slash

Not applicable
Author

OK, now I understand your question.

Does your variable have a specific set number of values, i.e. are the options fixed, or can the user type in anything they want to?

If it is a fixed number of options then what I use is a LOAD * INLINE function in the script to create a field that is not linked to the remainder of my data model, this will allow me to build list boxes that the user can select from. Having said that, you can do the same thing anyway with variables by creating a specific list for the variable to choose from.

I don't know of any way to actually create a field in the data model using a macro, although it might be possible, it would be possible to add to options in an existing field!

You probably need to explain a little more about what you are trying to achieve, why you are doing it that way etc, often there are different approaches that can work just as well.

Cheers,

Not applicable
Author

Ok. I understand.

If I create this inline:

Load * Inline [

val

0

];

I created one field called val. Now Can I transform in VB S the variable in field?

Thanks

Best regrds

Slash

Anonymous
Not applicable
Author

Slash,
The difference between variables and fields:
Variable is a named piece of data that has one and only one value at any given moment. The value can be set manually or in the script or by macro.
Field is as set of values (maybe one, or even none). Values in the field can be selected or not. Selection can be made manually or by a macro. The set of values in the field can be changed only by reload, as far as I know. (I'm intentially leaving aside dynamic update.)
I hope it will help you to better fromulate your question.

Not applicable
Author

jey Iknow the difference .

I ave to convert a variable build just 1 record in one field build hust one record. I know is possible in sql .

If I have a variable calle d=0

I can convert it to a field A =0

JUST one record.

However I solved .

byse and thank you

Slash

Anonymous
Not applicable
Author

OK

Not applicable
Author

Hi,

I hate to hijack the thread, but I cannot see anyything else that fits my query...

I want to create an intput field that will allow a max of 50 inputs from the web user. I then want them to be able to call them up by a macro button .

So simply - enter a customer details that have to be called back before close of shift. I know that if the PC goes off they lose the data as it's just in the buffer. But it means they don't need paper and pen.

Possible??

Thanks

Peter