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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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?

 

 

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

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
MVP
MVP

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')
)