Need a special offer?Find out if your project fits.
+

Pass params to compressor

Answered
kcl asked on December 7, 2017

I want to try using compressor to fetch data but data to fetch depends on the user asking for it and its id should therefore be used in the query to filter it (along with date range).
I tried using JSON to return the data I wanted but it seems to be too heavy so I wanted to try connecting to the compressor but with a look on the documentation I do not see how I could pass such parameters to the query I want to perform.
Is there any way I could pass one or multiple parameters to the compressor ?

8 answers

Public
Illia Brazhko Flexmonster December 8, 2017

Hi! Thank you for your question.
 
Taking into account that your JSON data file has 440986 records, we consider that using the compressor would be an optimal option for you.
 
The compressor is the library we provide for free. It was designed to compress the output of queries into optimized CSV. It is a library, so you can use it in your back-end the way you consider would be the best for your architecture. For example, there is an approach where GET parameters are used to provide that info. At the same time, your back-end already knows who is logged in, and there may be no need to pass it through GET request. These decisions are completely up to you, since we provide the library that can be included in your back-end and does the compression of the query result. The queries that select data should be added into your back-end code.
 
I would also appreciate if you could tell me your back-end technology and your database, this info would be useful if you have any additional questions. Thanks!
 
Regards,
Illia
Flexmonster Team

Public
kcl December 8, 2017

Hi Illia thanks for your answer,
I'm working on a application using Ruby on Rails / Postgresql . Thanks for your article I'll check how I get manage to connect to the compressor. 
 
Regards

Public
Ni Fujia January 8, 2018

Hello
I now have the same problem with Flexmonster Accelerator for Pentaho Mondrian. How do I get our user id in? Through mondrian sehema? I hope you can help me out. Thank you.

Public
Illia Brazhko Flexmonster January 8, 2018

Hi Ni Fujia!
Could you please provide us more information? What is 'user id' in your case? Is it one of the fields of your database or its user id in your system or user/role in a database?
Regards,
  Illia

Public
Ni Fujia January 8, 2018

Hello Illia!
Thanks for your answer!
User id is a field in my database through which I filter the query. Is it going to be passed in as a parameter? How? Or you can tell me the right thing to do.
Thanks!
Ni Fujia

Public
Illia Brazhko Flexmonster January 8, 2018

Thank you for the quick reply!
If you want to show data only for defined user id the simple way is to use a standard filter. Please see the following article to find more information how to predefine filter in the report: http://www.flexmonster.com/doc/slice/#report
In case you want to limit access to data you can configure roles in your cube. Here you can find related tutorials: http://www.flexmonster.com/doc/configuring-mondrian-roles/?hilite="roles"
Does it help?
Thanks,
 Illia

Public
Ni Fujia January 8, 2018

Hi Illia,
Thank you for the quick reply!
I think you may misunderstand me. I want to import this userid into SQL statement, instead of querying all the users to filter again, similar to the where userid='lisa'in SQL. What I want to know is whether mondian supports, or does flexmonster support it?
Thanks!
Ni Fujia

Public
Illia Brazhko Flexmonster January 8, 2018

OK. Your problem is clear.
Our component supports this feature for databases and for SSAS but not for Mondrian because it doesn't work with sub-selects.

Please login or Register to Submit Answer