7 Replies Latest reply: Jul 24, 2011 2:09 PM by Rob Wunderlich RSS

    Creating multiple inline functions

      Hi

       

      I am trying to load multiple files in qlikview.

      I need to sort three dates field based on the month.

      When i create one inline function then only one date field is sorted and other two are not.

      When i create multiple inline function then it goes into a loop and the file goes for a toss

      Can someone help me with the exact process of sorting multiple date(month) column

        • Creating multiple inline functions
          Stefan Wühl

          Hi,

           

          you try to sort the fields in script?

           

          Could you post the script here, please? It is much easier to help if we see what you are talking about.

          You could also post your QlikView application, if you want and if you think it is helpful.

           

          Stefan

            • Creating multiple inline functions

              LOAD * INLINE [

                  TF_Fill Position Month, Value,

                  November, 1

                  December, 2

                  January, 3

                  Feburary, 4

                  March, 5

                  April, 6

                  May, 7

                  June, 8

                  July, 9

                  August, 10

                  September, 11

                  October, 12

                  ];

               

               

               

               

              LOAD * INLINE [

                  TF_Open Position Month, Value,

                  November, 1

                  December, 2

                  January, 3

                  Feburary, 4

                  March, 5

                  April, 6

                  May, 7

                  June, 8

                  July, 9

                  August, 10

                  September, 11

                  October, 12

                  ];

                • Creating multiple inline functions
                  Stefan Wühl

                  Hi,

                   

                  I couldn't see your sort functions in your example give, so could you add them, please?

                   

                  If you load the two tables, you will get an association between the two "Value" columns, is this intended.

                   

                  Then, I guess you want to sort Month name like January to December, the problem here is that these are string literals, not numerical values, so we need to get a method to tell QlikView the correct order (just sorting the literals would start with April, ...).

                   

                  So we might need to add a column for sort order.

                   

                  Stefan

                    • Creating multiple inline functions

                      Hi Stefan

                       

                      To put it in simple way i want to sort two month columns.

                      When the month name is displayed in Qlikview it should follow the calendar sequence.

                      Can you please help me with the procedure how do i get it in qlikview

                        • Re: Creating multiple inline functions
                          Nagaian Krishnamoorthy

                          Try loading these as dual fields, as given below

                           

                          LOAD dual(string,numrep) as [TF_Fill Position Month]

                          INLINE [

                              string, numrep

                              November, 1

                              December, 2

                              January, 3

                              Feburary, 4

                              March, 5

                              April, 6

                              May, 7

                              June, 8

                              July, 9

                              August, 10

                              September, 11

                              October, 12

                              ];

                           

                          LOAD dual(string,numrep) as [TF_Open Position Month]

                          INLINE [

                              string, numrep

                              November, 1

                              December, 2

                              January, 3

                              Feburary, 4

                              March, 5

                              April, 6

                              May, 7

                              June, 8

                              July, 9

                              August, 10

                              September, 11

                              October, 12

                              ];

                           

                          Hope this helps.

                            • Re: Creating multiple inline functions
                              Stefan Wühl

                              Hi naveenkumar3000,

                               

                              to be sorted in calendar sequence and to hold the additonal value column, I think it should be like this

                               

                               

                              LOAD dual([TF_Fill Position Month],MonthOrder) as [TF_Fill Position Month]

                              , value

                              INLINE [

                                   TF_Fill Position Month, value, MonthOrder

                                   November, 1, 11

                                   December, 2, 12

                                   January, 3, 1

                                   Feburary, 4, 2

                                   March, 5,3

                                   April, 6,4

                                   May, 7, 5

                                   June, 8,6

                                   July, 9, 7

                                   August, 10, 8

                                   September, 11, 9

                                   October, 12, 10

                                   ];

                               

                               

                               

                              LOAD dual([TF_Open Position Month],MonthOrder) as [TF_Open Position Month]

                              , value

                              INLINE [

                                   TF_Open Position Month, value, MonthOrder

                                   November, 1, 11

                                   December, 2, 12

                                   January, 3, 1

                                   Feburary, 4, 2

                                   March, 5, 3

                                   April, 6, 4

                                   May, 7, 5

                                   June, 8, 6

                                   July, 9, 7

                                   August, 10, 8

                                   September, 11, 9

                                   October, 12, 10

                                   ];

                               

                               

                              With dual, you could use numerical sort on the field, but still use the string for representation. Please have a look at the dual function in manual.

                               

                              In any table or list box, you could then sort the field in calendar sequence.

                               

                              Please note, that value fields are linking the both tables. If that is not intended, rename one of them (or both, e.g. to valueOpen and valueFill).

                               

                              Regards,

                              Stefan