Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Changing the value of a variable set in tGlobalVar

Hi guys,
If I have a variable set using tGlobalVar example name and it's value is an empty string. How can I modify it using tJava?
and if I ever declare a variable in tJava is it possible that can I call that variable in other components? If yes how?

Thanks,
drixs
Labels (3)
13 Replies
Anonymous
Not applicable
Author

Hi
No, because it always set 'count' back to 0 on tGlobalSetVar, and set 'count' to 1 on tJava, so the value always is: 0,1,0,1...
Best regards
Shong
Anonymous
Not applicable
Author

ohh.. so that's how it works.
Do you have any job layout which may similar above.
Anonymous
Not applicable
Author

Hi
Yes, I done many similar jobs before, but it depends on your specific needs. Normally, I use the tJavaFlex component, for example:
tFileInputDelimited---tJavaFlex--tLogRow
on the begin part of tJavaFlex:
int count=0;
on the main part of tJavaFlex:
count=count+1;
on the end part of tJavaFlex, set the count to a global variable, so that it can be used later on other component:
globalMap.put("count",count);
Best regards
Shong
Ravi_Rajagopal
Contributor III
Contributor III

Hi I am retrieving an integer data from an Oracle table via tDBinput component. Then I am trying to assign it to a variable called vInvitationID using tGlobalVar ​component. However during runtime it's retiring out saying I am assigning integer to a string. How do I resolve this problem?