Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
leahslate
Contributor
Contributor

Populate table based on index + 1

I have a data source that consists of chat log details between customer support and customers. Each chat line is indexed with the customer support message and customers response
  Index   Chat Subject   Customer Support Message                   Customer Response                
 ------- -------------- ------------------------------------------ --------------------------------- 
  1       Help           Hi, how can I help you?                    I want to track my order status  
  2       Help           No problem, do you have an order number?   7899564                          
  3       Help           Thank you, your order should arrive soon                   
In Qlik I want to create an app that has tables. The first table includes
  Index   Chat Subject   Support Message                           
 ------- -------------- ------------------------------------------ 
  1       Help           Hi, how can I help you?                   
  2       Help           No problem, do you have an order number?  
  3       Help           Thank you, your order should arrive soon   

How can I make it where if a user selects the first line in the first table, Qlik takes in the index value and then in the second table it shows the customer response where the index is one more than the users selection?

For example the flow would be: end user selects the first line, Hi, how can I help you? where the index = 1, the second table should populate with 7899564
Labels (3)
1 Reply
RafaelBarrios
Partner - Specialist
Partner - Specialist

hi @leahslate 

I'm not entirely sure what you need, but I'll give it a try.

so, lets say this is your original table

original_table:
load * inline [
Index|Chat Subject|Customer Support Message|Customer Response
1|Help|Hi, how can I help you?|I want to track my order status
2|Help|No problem, do you have an order number?|7899564
3|Help|Thank you, your order should arrive soon
](delimiter is '|');

 

by using a resident load i will call again the table and just keep the agent information and create a key field

operator_table:
load
Index,
[Chat Subject],
Index+1 & '-' & [Chat Subject] as Key_field, //this will link my customer table
[Customer Support Message]
Resident original_table;

and again using resident will create a customer table

customer_table:
load
Index & '-' & [Chat Subject] as Key_field, //this will link my agent table
[Customer Response]
Resident original_table;

now i can drop the original table as i dont need it anymore

drop table original_table;

 

the result

RafaelBarrios_0-1688421982564.png

RafaelBarrios_1-1688422100170.png

RafaelBarrios_2-1688422122835.png

 

Hope this helps,

help users find answers! Don't forget to mark a solution that worked for you & to smash the like button!