Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sannidhikumar
Creator
Creator

sorting months

Hi All,

how to sort Year and month in order Ex: jun-2017,may-2017.

Capture.JPG

thanks ,

18 Replies
prma7799
Master III
Master III

Send some scramble data ...

Scrambling Data

sannidhikumar
Creator
Creator
Author

QUALIFY *;

UNQUALIFY HIER_ID;

CustomerLedger_vw_QlikView:

LOAD ActualReserve,

     ActualReserve_USD,

     Bucket,

     BusinessUnit,

     BusinessUnitDescription,

     CO,

     Collector,

     CollectorName,

     CompanyCode,

     COMPANYID,

     ContractStatus,

     ContractStatusDesc,

     ContractType,

     ContractTypeDesc,

     CurrCode,

     CustNo,

     CustomerName,

     Diff,

     DocNo,

     DocPayItem,

     DocTy,

     //date([Due Date],'MMM-YY') as MonthYear1,

     Date(Date#([Due Date],'DD-MM-YYYY'),'MMM-YY') as MonthYear1,

     year([Due Date])*100+month([Due Date]) as periodno,

     //Date(Monthstart([Due Date]), 'MMM-YYYY') as MonthYear1,

     [Due Date] AS Due_Date,

  Month([Due Date]) & '-' & Year([Due Date]) AS MonthYear,

     FX_CONV_RT,

     GrossAmount,

     GrossAmount_USD,

     HIER_ID,

     InvoiceDate,

     InvoiceRef,

     InvoiceRefNo,

     LOB,

     LOBDescription,

     NationalAccount,

     NationalAccountDescription,

     NoOfInvoices,

     NoOfUnits,

     OpenAmount,

     OpenAmount_UC,

     OpenAmount_USD,

     OpenOverDue120,

     OpenOverDue180,

     OpenOverDue360,

     OpenOverDue60,

     OpenOverDue90,

     ParentCustomer_Number,

     ParentCustomerName,

     PaymentTerm,

     PaymentTermDesc,

     Pkey as PKEY,

     ProjectNo,

     SellRep,

     SellRepName,

     Tax,

     Tax_USD,

     TaxableOpenAmount,

     TaxableOpenAmount_USD,

     TotalNoOfInvoices,

     TotalNoOfUnits,

     TranAmt,

     TranAmt_USD,

     TranCurr,

     TranOverDue90,

     [WO G/L Date]

FROM

$(QVDPath)CustomerLedger_vw_QlikView.qvd

(qvd);

UNQUALIFY *;

prma7799
Master III
Master III

Hi Pradeep ,

We don't want script we need sample application with scrambling data ...

Go to >> Setting >> Document properties >> Scrambling

Untitled.png

Anil_Babu_Samineni

May be use at last Order By Date(Date#([Due Date],'DD-MM-YYYY'),'MMM-YY') ASC;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jonathandienst
Partner - Champion III
Partner - Champion III

If you convert the dates from strings into numeric date values, then you can sort them numerically. Load them something like this:

LOAD

     ...

     Year,

     month,

     Date#(month & '-' & Year, 'MMM-yyyy') as YearMonth,

     ...

Adjust to your environment and requirements.

If you need more specific help, you will need to provide more information and a sample qvw file.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sannidhikumar
Creator
Creator
Author

Jonathan ,

i tried but still the same i am getting .

any other idea.

thanks ,

sannidhikumar
Creator
Creator
Author

Anil ,

i am using the same in the back end .

thanks,

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Where is your screenshot from, is this a PivotTable we are looking at?

Sorting can be a bit strange in pivots, but you should be able to get it to behave.

Right click the chart and then click Properties.

Select the Sort tab.

Ensure that Y Value is not clicked for any dimension (this will break things)

Click the Month dimension

Ensure that Numeric Value is ticket - and nothing else is selected

Click OK

Hopefully that will do it, if not...

Add a ListBox to your app with the Month field in it, and then advise whether that ListBox sorts correctly, and whether the dates are left or right aligned.

Steve

Frank_Hartmann
Master II
Master II

this thread might be helpful for frontend solution using Mod function:

Re: Current Year vs Previous Year Sort Order

hope this helps