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: 
kunkumnaveen
Specialist
Specialist

Needed a Correction in a syntax

Hello All ,GM

I trying to sort Bucket Column based upon Bucket Date at backend (Scripting),the syntax I have written is 

Scripting.PNG

Dual(Bucket,num(date(Timestamp#(Bucket_Date, 'MM/DD/YYYY hh:mm:ss'), 'YYYY/MM/DD' ))) as [Bucket],

output :

Sorting.PNG

 

If we observe the above table the Values in the Bucket  Column(3rd) suppose to be as same as the test_Bucket column but what I am getting is wrong 

Please suggest what change do I need to do in the dual Syntax or can we sort the bucket with any other syntaxs

 

Thanks

 

 

2 Replies
avinashelite

I don't see any issue with the syntax , please check on the expression results , I feel it is giving he null/blank output 

marcus_sommer

BucketDate needs to be to correspond with the multiple values from Bucket - but this doesn't happens here. Regarding to your screenshot you have two different dates and therefore you get two different string-values from Bucket.

This means you couldn't use BucketDate as numeric value within the dual(). Maybe you could use another field and/or creating with recno(), rowno() and/or autonumber() in any combination an unqiue field-value. Another approach might be to load the relevant tables and/or fields-combinations with your wanted sort-order.

- Marcus