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: 
Pavithra_2198
Contributor
Contributor

Chart expressions

Hi,

I want to sort the date field in x-axis for my bar chart in chronological order (Jan, Feb, Mar....).

Should be represented as : 2021-Sep-13_A(Mon), 2021-Oct-21_B(Thu)

I tried doing like this in expression : 

year(date(date#(left(date,18),'YYYYMMDD')))  & '-' & month((date(date#(left(date,18),'YYYYMMDD'))) &  '-' & date((date(date#(left(date,18),'YYYYMMDD'))) & '_' & ('A' or 'B'& '(' & day((date(date#(left(date,18),'YYYYMMDD'))) & ')'

how could I solve this?

 

 

1 Solution

Accepted Solutions
sunny_talwar

Use Dual function

Dual(
//Text Part
Date(Date#(Left(date, 18),'YYYYMMDD'), 'YYYY-MMM-DD') & '_' & ('A' or 'B') & '(' & Day(Date#(Left(date, 18),'YYYYMMDD')) & ')',

//Number Part
Date#(Left(date, 18), 'YYYYMMDD')
)

View solution in original post

1 Reply
sunny_talwar

Use Dual function

Dual(
//Text Part
Date(Date#(Left(date, 18),'YYYYMMDD'), 'YYYY-MMM-DD') & '_' & ('A' or 'B') & '(' & Day(Date#(Left(date, 18),'YYYYMMDD')) & ')',

//Number Part
Date#(Left(date, 18), 'YYYYMMDD')
)