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

 

 

Labels (1)
2 Replies
avinashelite
MVP
MVP

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

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