Friday, 10 March 2017

QlikView best practices for Developers

Best practices for efficient QlikView development and to speed up the document :

  • Keep all the identical formulas and expressions in a single variable, and we can reuse the same variable everywhere, Hence the expressions            wont get repeated and if we want to modify the expression we can make the changes to a single place rather than changing in all the places.
  • Always try to do all the calculations in script level it self, and drop the unnecessary fields from the data model.
  • While using ApplyMap functionality, always keep all the mapping table tabs immediately after the Main tab.
  • Avoid RESIDENT loads. If needed, load twice from a QVD.
  • Avoid IF() conditionals in any object expression, use instead set analysis.
  • Always link two tables using the fields with numeric values instead of a string (AutoNumber() function will help if we don't have any default                  unique numeric field).
  • If sorting is not needed, turn it off.
  • Limit the number of text values in a field :Break up long strings into separate component fields rather than using one. For example, if you have          the complete address in a field you can separate it in different fields like street, city, zip code, etc.
  • Wednesday, 1 March 2017

    Defining Current Culture (Kendo UI)

    Internationalize the current page using a culture script., All the informations regarding different culture is placed in a separate javascript files and shared across using Kendo.Culture(). We can include different cultures as per our requirement.

    • First we have to add the required culture script to the page.
    • Set the Culture script, for example: data formats (see the below method) - 

            currentDateCulture(): string {
                var pattern = kendo.culture().calendar.patterns.d;
                return pattern;

    Here in the above example it will return a date format for the current locale 
    (for eg: If our current locale is Australia (en-AU) it should return - "d/mm/yyyy").

    • The default culture, which Kendo UI is "en-US".

    Monday, 20 February 2017

    Dynamic Grouping in Kendo Grid (AngularJS)

    Kendo is providing a default functionality for grouping in grids (ie groupable: true),
    But one issue with this approach is, Once we set  the property to true we will be having a grouping header template at the top of the grid and it will get enabled to all the columns in that grid.
    What if the requirement is like, we don't want the header template and we have to set the grouping to a specific column in the grid.

    Here is the solution :-

    var dataSource = new{
      data: [
        { name: "Jane Doe", age: 30 },
        { name: "John Doe", age: 33 }

    In the above example, we have got two fields name and age, I am trying to group my grid with the field age (ie group:"age").
    Here in this scenario, we wont be having the grouping header template and we specify grouping to a predefined column.

    We can pass the field name from metadata DB rather than hard-coding in the source code.

    Tuesday, 14 February 2017

    Date Issue in JSON.stringify

    Are you facing any issue for date fields in JSON.stringify ?

    Sometimes we face some issues with the date while we convert javascript value to jason string using JSON.stringify.

    One of the solution is converting the date as shown below, you can make use of the below method for performing  that :

     dateParse(dateValue: string): Date {
                var parsedDate: Date = kendo.parseDate(dateValue);
                parsedDate.setHours(0, 0, 0, 0);
                parsedDate.setHours(new Date().getHours(), new Date().getMinutes(), 0, 0);
                parsedDate.setHours(parsedDate.getHours() - parsedDate.getTimezoneOffset() / 60);
                return parsedDate;

    Note : This is written in Typescript

    Friday, 10 February 2017

    Right Chart, Perfect Visualization

    Confused!, which chart for which data ?

    Bar Chart
    •  Bar graphs are used to compare things between different groups.
    •  They are the best to measure changes over time especially when the change is huge. 
    •  More effective when you have numerical data that splits nicely into  different categories so  you can quickly see trends within your data.
    Line Chart :
    • Display trends over short and long periods of time.
    • When smaller changes exist, line graphs are better to use than bar graphs.
    • Comparing different groups over same time period or vice versa.
    Pie Chart :
    • Showing relative proportions or percentage of information.
    • Pie charts are best to use when you are trying to compare parts of a whole.
    • In fact, they do not show changes over time.
    Scatter Plot :
    • Scatter plots are an effective way to give you a sense of trends.
    • Investigating the relationship between different variables.
    • eg : Male versus female likelihood of having lung cancer at different ages.
    Bubble Chart
    • Bubble chart are mainly viewed on either scatter plots or maps.
    • Size of the bubble provides the meaning about the data.
    • eg: Sales trend over product and geography.
    • TreeMap has got a series of rectangles, nested within other rectangles.
    • Showing hierarchical data as a proportion to the whole.
    These are some of the commonly used charts in visualization, we have got a lot more just like Gantt chart,Heat maps,Bullet chart etc.

    Sunday, 5 February 2017

    SQL Feature

    Scared of working with live DB?

    Once we delete some particular data from live DB, thats it. To avoid doing mistakes we can make use of the feature begin tran and rollback, Where we can cross check the change and confirm it. Thereafter we commit the same to the live DB.

    Syntax :

    Step 1:-
            begin tran

    Step 2:-
             delete Table1 where Column1='1' and Column2='2'

    Step 3:-
              select * from Table1 where Column1='1' and Column2='2'

    Step 4:-
      rollback (or Commit)

    Thursday, 2 February 2017

    QlikView Feature : Direct Query or Direct Discovery

    As we all know QlikView is an InMemory Tool, What if we have a large dataset?
    One of  the solution is Direct Discovery feature in QlikView, it is possible to load aggregated query results into QlikView without loading the complete dataset into the QlikView data model using the Direct Discovery function.

    Syntax : 

    DIMENSION Dim1, Dim2

    FROM TableName