Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
prma7799
Master III
Master III

Sorting issue in date

Hi All,

I have taken invoice date and more 5 fields as dimension my requirement is that I want data sorting as by Invoce date.

For that I took  = num(month([First Invioce Date])) dimension in first column but data is not sorted as per our requirement.

My expected output is

sorted data should come as apr-14

                                         May-14

                                          aug-14

                                           ................

                                       apr 15 like this.

But still am getting below sorting which not correct. Please help

sort.png

19 Replies
prma7799
Master III
Master III
Author

Any help on this

swuehl
MVP
MVP

The sorting should be correct anyway if you follow previous recommendation.

If you want to create a fiscal year calendar, with year starting in april, have a look at

Fiscal Year

Not applicable

First  Make sure [First Invioce Date] field format  is strinig or Date .

If  it is string then  use Date# & Date function to conver string to date  then  it  will wrok .

Num(date(date#([First Invioce Date],'DD/MM/YYYY')))
this expression use in sort tab-> expression

I hope it will work

settu_periasamy
Master III
Master III

May be try this, in your Sort -> Expression


=Date(Date#([First Invioce Date],'DD/MM/YYYY'))

remove the other sort

prma7799
Master III
Master III
Author

Sort is coming from August means 8 5 3 2 like this

August

may

march

feb

I want data should come like below

Apr

May

Jun

Jul

Aug

Sep

Oct

Nov

Dec

Jan

Feb

Mar

Thanks

settu_periasamy
Master III
Master III

I didn't mean the 'Sort' FieldName(In picture)

Chart Properties -> Sort Tab -> Promote your 'Invoice Data' Field to top. ->

In the Expression

=Date(Date#([First Invioce Date],'DD/MM/YYYY'))

-> Ascending

Not applicable

Hi,

Add these lines in master calendar

Set vFiscalMonthStart = 4 ; 

                                                     

Calendar:
Load Dual(_fiscalYear-1 &'/'& _fiscalYear, _fiscalYear) as FiscalYear,       

         Dual(Month, _fiscalMonth)                as FiscalMonth,        
          *;
Load Year + If(Month>=$(vFiscalMonthStart ), 1, 0) as _fiscalYear,         
         Mod(Month-$(vFiscalMonthStart ), 12)+1        as _fiscalMonth,        
          *;

Load * from MasterCalender;

and use FiscalYear&FiscalMonth  in sort tab under expression.

elakkians
Partner - Contributor III
Partner - Contributor III

What you are looking can be achieved by creating fiscal calendar , which has April as the starting month ,

take a look at this

Fiscal and Standard Calendar generation 

settu_periasamy
Master III
Master III

Hi,

Give the same expression which you have used in First Invoice Date:

Chart Properties -> Sort Tab -> Promote your 'Invoice Data' Field to top. ->

In the Expression

=If(date([First Invioce Date])>=Date(vStartDate) and date([First Invioce Date])<=Date(vEndDate),

date([First Invioce Date]))

=> Ascending

buzzy996
Master II
Master II

try to sort ur Invoice date in script it self, by using order by invoice date and in sort tab use Load order check box as Original.

hth