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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
scottacooper
Contributor
Contributor

Sorting On Calculated Dimension

Hello Community,

 

I have a bar chart with a calculated dimension based on the following logic to adjust a datetime column which is in UTC :

if(state='CA',time(myTimeColumn-8/24,'hh:mm'),
if(state='DC',time(myTimeColumn-5/24,'hh:mm'),
if(state='FL',time(myTimeColumn-5/24,'hh:mm'),
if(state='GA',time(myTimeColumn-5/24,'hh:mm'),
if(state='IL',time(myTimeColumn-6/24,'hh:mm'),
if(state='LA',time(myTimeColumn-6/24,'hh:mm'),
if(state='MA',time(myTimeColumn-5/24,'hh:mm'),
if(state='MI',time(myTimeColumn-5/24,'hh:mm'),
if(state='NY',time(myTimeColumn-5/24,'hh:mm'),
if(state='SC',time(myTimeColumn-5/24,'hh:mm'),
if(state='TN',time(myTimeColumn-6/24,'hh:mm'),
if(state='TX',time(myTimeColumn-6/24,'hh:mm'),
if(state='VA',time(myTimeColumn-5/24,'hh:mm'),
time(myTimeColumn,'hh:mm')
)))))))))))))

I would like to sort the X-axis of the bar chart in order of the adjusted time and cannot create this calculated field during data import as the state column and myTimeColumn are in two separate tables.

Adding this logic in the sort expression doesn't seem to make any difference, the x_axis doesn't seem to have any obvious sort order.

1 Reply
Anil_Babu_Samineni

May be try this?

Match(state, 'CA', 'DC', 'FL', 'GA', 'IL', 'LA', 'MA', 'MI', 'NY', 'SC', 'TN', 'TX', 'VA')

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