Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Updating field from Inputfield

Hello guys,

Would you please help me with this.

I have a table with 3 fields

     Order_No

     Comments     inputfield

     _Comment2     this field is used in a pivot table because I can not use the inputfield to group the rows.

I want to change the value of the inputfield  and update the _Comment2 field for the current Order_No.

I've been trying with some lines with out success.

1.-

     ActiveDocument.DynamicUpdateCommand("Update MyTable SET _Comment2 = Comments Where Order_No='1'")

but not working.

2.-

Declaring variable into settings as sMyVar and the default value with =Comments, and on the trigger section I added Set Variable for the Comment field OnChange action like, Variable sMyVar and Value =Comments.

In a macro code:

     set vValor = ActiveDocument.Variables("sMyVar")

     MsgBox ( vValor.GetContent.String)     '(here i get an error "Object required vValor" and stops macro)

     ActiveDocument.DynamicUpdateCommand("Update MyTable SET _Comment2 = '"&vValor&" Where Order_No='1'")

-----------------------------

I'll appreciate all kind of help about this issue.

Thanks

Karim

1 Solution

Accepted Solutions
fosuzuki
Partner - Specialist III
Partner - Specialist III

QlikView treats each inputfield's value as unique, and as you've already discovered, it will not group the values.

In your load script, you can create your table using the Order_no and Comments fields, and declaring the Comments field as an inputfield. In the pivot table, instead of using the Comments field as your dimension, use a calculated dimension as: text(Comments). This cheat will make QlikView override the default inputfield behaviour an it will behave as a standard field, grouping the equal values!

Hope you understand it!

Fernando

View solution in original post

5 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi Karim,

I think you can use an inputfield in a pivot table dimension.

Check my attached sample.

Hope this helps you.

Regards,

Fernando

Not applicable
Author

Hi Fernando,

I can't open your sample, becaus I am using a personal edition.

Can you explain it. ?

Thanks.

Karim

fosuzuki
Partner - Specialist III
Partner - Specialist III

QlikView treats each inputfield's value as unique, and as you've already discovered, it will not group the values.

In your load script, you can create your table using the Order_no and Comments fields, and declaring the Comments field as an inputfield. In the pivot table, instead of using the Comments field as your dimension, use a calculated dimension as: text(Comments). This cheat will make QlikView override the default inputfield behaviour an it will behave as a standard field, grouping the equal values!

Hope you understand it!

Fernando

Not applicable
Author

Hi Fernando,

Thanks for your help, thats what I am lookin for.

After your answer, I tried with = before the inputfield and works same as Text function.

Then, to group the inputfields as dimension in charts:

=Text(inputfield)     or

=Inputfield

Thanks again.

Karim

Anonymous
Not applicable
Author

Many thanks Fernando, this is brilliant