Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
dsharmaqv
Creator III
Creator III

Sorting Week No in chart

Hi I am displaying weekly trade amount in line chart but unable to sort the week according to the dates.

for example

week 52 for yr 2016 should appear before the week 1 of yr 2017

Can ome one help me out with this

table:

   

Week_NoSURV_DateTrade Amt
102 01 170.8
423 01 170.6
530 01 170.33
5226 12 163.2
606 02 171.4
820 02 173.8
927 02 172.2
1 Solution

Accepted Solutions
sunny_talwar

May be use a calculated dimension

Dual(Week_No, WeekStart(SURV_Date))

View solution in original post

7 Replies
sunny_talwar

May be use a calculated dimension

Dual(Week_No, WeekStart(SURV_Date))

dsharmaqv
Creator III
Creator III
Author

Thanks Sunny

Also can you please help me in getting the latest week sales amt

in above case week no 9 has sales amt 2.2

sunny_talwar

May just this

Sum({<SURV_Date = {"=$(Max(SURV_Date))"}>}[Trade Amt])

dsharmaqv
Creator III
Creator III
Author

I am trying to display latest value in text object but with above expression I am getting 0

sunny_talwar

My bad, I misplaced an equal sign

Sum({<SURV_Date = {"$(=Max(SURV_Date))"}>}[Trade Amt])

dsharmaqv
Creator III
Creator III
Author

expression is summing up all the values

returning

12.33

can you please post the app.

sunny_talwar

I create a new field to do this

Table:

LOAD *,

  Num(Date#(SURV_Date, 'DD MM YY')) as DateNum;

LOAD * INLINE [

    Week_No, SURV_Date, Trade Amt

    1, 02 01 17, 0.8

    4, 23 01 17, 0.6

    5, 30 01 17, 0.33

    52, 26 12 16, 3.2

    6, 06 02 17, 1.4

    8, 20 02 17, 3.8

    9, 27 02 17, 2.2

];


Capture.PNG