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: 
Anonymous
Not applicable

Load data from ruby file

Hi All,

Please any can help me how to get data from ruby file

15 Replies
Not applicable
Author

Click the 'Use advanced editor' option to attach the files in the reply.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

This is a weird discussion. Here's the result of my guesswork.

QlikView is a capable ETL tool that easily reads data in various formats and databases. Some manual work is still necessary however when attempting to read novels, tax forms, license plates and source code. Your example contains only four groups of setting so I took the time to manually convert them into something QlikView can understand. See attachments.

If in reality there are many more groups in the ruby source, you may consider writing a tool in a general purpose scripting language (like perl) to process groups of values into comma-separated lines.

Note that the ruby code is a little bit inconsistent. The last value is stored in a variable alternately called r_name or retailer_name.

Good luck,

Peter

Anonymous
Not applicable
Author

hi Peter,

Thanks for help and Its a typo mistake,retailer_name is correct.

i don't have idea how ruby file is converted to csv or excel.

its a regular update we need from ruby file.

Thanks

Nitha

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Well, the attachment is only an example of what to feed into QlikView.

If you need updates on a regular basis, that means that someone or something is updating the ruby code on a regular basis as well. These updates can be done anywhere (csv, ruby program, database table) as long as you don't have to do them twice and in different places. As far as I can see with limited information, you have two options to handle this quickly:

  • Change your ruby code so that the configuration information is read from an external (csv?) file. The updates need only be done in a single spot, the external file, and both the ruby program and your QlikView application will follow suit. Your r_for_retailer subroutine now needs to do a csv table load, a lookup with the value of parameter retailer, and a load of the different variables with the values found in the corresponding columns.
  • Or recode the ruby program so that the settings for every retailer value are listed in a table-like format at the beginning of the program (a dictionary or whatever this is called in ruby). If you tag the table with comment-like items before and after the actual rows, QlikView can be programmed to extract these lines without too much difficulty.

But keep in mind that the QlikView script engine is no parser construction toolkit.

Peter

Anonymous
Not applicable
Author

Hi All,

Please check rb file i attached and help me with solution

Anonymous
Not applicable
Author

Thanks,please check rb file attachment