Pass params to compressor
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 ?
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, the approach when GET parameters are used is mentioned in the following article http://www.flexmonster.com/blog/sql-pivot-table-best-performance/. 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!
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.
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.
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?
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.
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?
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?
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.