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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with dual

Hi all,

I have expression

WeekStart(date(oDate))& '-'  &WeekEnd(date(oDate)) as WEEK  result looks like 01/01/2012 - 01/07/2012, etc.

I need to sort varaible WEEK.

How can I do it?

Thanks in advance,

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

dual(WeekStart(date(oDate))& '-'  &WeekEnd(date(oDate)),WeekEnd(date(oDate)) ) as WEEK

I put ) in right place

View solution in original post

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try the dual function to create a field with both a textual and a numeric value. That way you can sort it numerically.

dual(WeekStart(date(oDate))& '-'  &WeekEnd(date(oDate),WeekEnd(date(oDate))) as WEEK


talk is cheap, supply exceeds demand
MayilVahanan

HI

Try like this

dual(WeekStart(date(oDate))& '-'  &WeekEnd(date(oDate),WeekStart(date(oDate))) as WEEK

Edit:

Can you post a sample file? if its not satisfy

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

I like both your answers

I don't understand how works dual function.

this my expression WeekStart(date(oDate))& '-'  &WeekEnd(date(oDate)) as WEEK, which gives me WEEK varible. (it's string) I can sort only by text. I need to create something to match it with number.

when I use your expression, i get error dual takes 2 parameters.

what's the second parameter should I use?

Cheers

Anonymous
Not applicable
Author

Thank,

I got it.

Anonymous
Not applicable
Author

dual(WeekStart(date(oDate))& '-'  &WeekEnd(date(oDate)),WeekEnd(date(oDate)) ) as WEEK

I put ) in right place