Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Re-use logic between applications

Hi

Ctrl+C, Ctrl+V must be one of the most frequently used key combinations among programmers [:D]

There are however some problems related to copy and paste.
In our scenario we have maybe 50 applications and it's growing fast.
Often there are cases where parts of an applicaitons logic has already been done in some other app.
Up until now we've used the copy/paste method but in the long run this will be a nightmare to maintain.
If we find an error in the logic we must keep track of which applications have used the same logic, bla bla bla. I think you get my point.

I just want to have your input on how you solve these issues.
qvd-files? binary loads? include files?

All of them have pros and cons.

There must be others out there that have the same problems. Let's get a discussion going on how to solve it in the most effecient way.

/Fredrik

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Fredrik

This a great topic for discussion! As Qlikview moves rapidly into serious enterprise applications, re-usability of the code / expression logic becomes more important than ever.

Your three suggestions do indeed have pros and cons, but I think they solve different problems. This is how I have usd them.

QVD files are good for incremental loads; intermediate storage by a 'QVD generator' qvw to avoid hitting a production database by each model;or again by a QVD generator when there is complex transformation logic that is shared by several models.

Include files work well for script logic that is common to several models. I have used includes for loading holiday dates from a spreadsheet fo a series of models that were based on working days. The include file created a variable that was used to add the holiday dates when calling the QV working day calculations in the script and in the model expressions. Includes are also good for common mapping tables loaded inline. I only moved script to an include file after it had been fully tested and production hardened.

Binary loads. I have only used binary loads for testing and developing models. I have never used it in a production model. Perhaps someone else has found it useful in some application(s).

If I may make another suggestion: expression variables. In other words, complex expressions , or fragments of expressions, saved in variables and used by $() macro expansion. Once tested, these can be created by Set vVar = **** statements in an include file.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Fredrick,

there is always more than one way, and the definition of "most efficient" can vary a lot between different organizations...

I agree with most of Jonathan's points. In addition, I'd add:

Binary loads are a great tool for segregating duties between Developers (script) and Designers (UI). If you have different people responsible for those tasks, BINARY load is the best way of facilitating the "Hand shake" between them.

Expressions as Variables - yes, agreed, I've been using them in many of my applications. Since version 9.00, I'm coming to a conclusion that Expressions Export/Import might be even a better solution. If development team does a good job of naming and categorizing various expressions, and perhaps organizing them into folders, I can see a very robust solution allowing the Designers (power users) to simply pick the right expression for the list, and receive "the whole package" - the formula, all the attributes, number formatting, label, etc... Of course, it would take time to organize and document, but the end result can be very powerful.

A word of caution about reusing pieces of logic - speaking of pros and cons... Once various pieces of logic are heavily shared between developers, departments, applications, etc... - at some point, you can't make any changes without calling a summit of all involved parties. With all the benefits of sharing, comes the pain of higher dependency between different groups. In some organizations, it may become counter-productive. You may need 5 minutes to make a change and 3 weeks to get it coordinated with all involved parties...

just my 2 cents...

johnw
Champion III
Champion III

I've used a binary load once in a production application. I basically have two applications that are clones of each other, but one of them has had all of the revenue data stripped out. The stripped application is available to a wide group of users. The one with the revenue data to only a small number of users. This probably could have been handled with some other security model, but at the time we weren't even using access point, and we wanted to restrict the users with Windows permissions, not even letting users into the directory with the revenue data.

A much better use of binary load is what Oleg pointed out, where one group is responsible for script, and another for the display objects. The group writing script could just create QVWs without any user objects. You could have an Orders QVW with all of the tables related to customer orders, for instance. You could have multiple user applications created from this. Each would binary load the data, avoiding any duplication of script, and keeping the responsibilities separate. And then each application could have the display built however was appropriate for that application. Even if the duties are all in the same group, or even the same person, it would still be beneficial to binary load if you have several applications with the same data model.

We do use QVD files everywhere. We have a lot of exceptions, but the general rule is that applications load only from QVDs.

We haven't used include files. Very little script is shared in common between applications, so I'm not sure there would be much benefit for us personally using include files. I do think I could benefit from a calendar include and a text mapping include at some point, though. Those are getting more complicated yet more similar between applications all the time. At some point I need to bite the bullet and switch to a more integrated approach.

We haven't used variables for expressions very often, and where we have, they have not been shared between applications, only used within the same application. I've run into bugs with variables holding expressions that make me nervous about using them more widely. But so many people are using them happily that I think I just got really unlucky in how I first started using them.


Oleg Troyansky wrote:Once various pieces of logic are heavily shared between developers, departments, applications, etc... - at some point, you can't make any changes without calling a summit of all involved parties.


We've been lucky in this regard. First, we've been lucky that most of our shared resources (mostly the QVD data warehouse) were somehow built correctly the first time, so we've had little need for any disruptive changes. When we do need changes, our department is in charge of almost the full process end to end, from the business systems that create the data in the databases, to building the QVD data warehouse from those databases and other sources, to user application script, user application design, and setting up the Publisher tasks. While I have no official authority (I'm just a cubicle grunt), I've taken on the role of benign dictator for much of this. So when I want to make a change, I make a change, often without even consulting anyone, and I just make sure I check and as necessary fix anything that could be affected. So far no complaints or conflicts of any significance that I'm remembering. *crosses fingers*

That probably wouldn't be typical of the QlikView group(s) in most companies, though. There ARE aspects of what we do that DO suffer from this sort of paralysis, with a 5 minute change taking 3 weeks. They just aren't on the QlikView side of the house.

Not applicable
Author

Thanks all for replying

I think you all have come to the same conclusions as I did. There isn't really any rules you can follow, the best approach will vary from case to case.
Oleg, you pointed out my biggest concern. If you share logic between applications and then that logic changes you might be in seriuos trouble.
This is why I'm beginning to think that Ctrl+C, Ctrl+V might be the best approach after all 🙂

I mean this way you won't need to debate whatever impact the changes will have on all applications, if you need to change one app just go ahead. The changes won't impact any other applications.

It would be nice however if you could keep track which applications have copied logic from your own application and that way you could notify those developers of the changes you've made.

I think that what's the really important thing here is just that. Whatever approach you use to share logic you have to keep track of which applications that use that logic. Otherwise you won't know what impact any changes will have.

Btw, wouldn't it be a good idea to have another section in the forum for these kind of discussions. They seem to disappear among the posts about set analysis expressions and so on.

/Fredrik