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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Iterate CSV file to set context variables for each row

Hi,
I am trying to set context variable values from csv file columns, i.e. each column has value for a context variable, any comments on how to do that ?

Labels (2)
6 Replies
vapukov
Master II
Master II

csv file must have only 2 columns one with name "key", second with name "value"
each row contain 1 key and 1 value
Anonymous
Not applicable
Author

Thanks Vapukov for reply , Actually I need 4 columns to be substituted into 4 variable in one iteration, I tried that method using a properties files and tcontextLoad but it does not fulfill requirements
vapukov
Master II
Master II

sorry, can understand - what is You problem with normal tContextLoad? I load 100 variables at one iteration

all simple:
[list=*]
  • plain csv file - JUST 2 columns "key","value", as many rows as You need - 4-6-10-999

  • tFileInputDelimited -> connect to next by Main connection

  • tContextLoad

  • Anonymous
    Not applicable
    Author

    thanks vapukov , really appreciated your reply, I understand we can set all context variables using key value map into context load but my problem is i need to iterate this for 20 times and in each execution new values will be assigned to 4 variables. so i am trying to iterate csv file with 4 columns and 20 rows.
    vapukov
    Master II
    Master II

    think You mix context and normal csv file

    why just not define csv file - as many columns as You need
    than tFileInputCSV -> tFlowToIterate -> and use Your 1000 variables as You want

    Context is context, and do not try to use it wrong
    Anonymous
    Not applicable
    Author

    I have created separate file for each job and then used tFileList-->iterate-->tFileInputDelimited-->tContextLoad. 
    thanks for your time 0683p000009MACn.png