
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Tags:
- qlikview_scripting
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Karim,
I think you can use an inputfield in a pivot table dimension.
Check my attached sample.
Hope this helps you.
Regards,
Fernando

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Fernando,
I can't open your sample, becaus I am using a personal edition.
Can you explain it. ?
Thanks.
Karim


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks Fernando, this is brilliant
