Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikMo
Contributor III
Contributor III

How do I convert a week-year string to dual

I am storing weekly QVD snapshots using the function WeekName(date) as the filename (e.g. 2022/40). When I load that file back in I use the filename as a snapshot WeekYear field to differentiate it from other snapshots.

The issue I have is that the WeekYear field has now lost the dual functionality and is treated as a string. This is only an issue for me when sorting charts - Sort by numeric value is not working, however A-Z sort does (but I don't want to rely on this).

How can I get the dual functionality back for a WeekName() formatted string? 

 

LOAD
'$(a)' as WeekYear
...

from [C:\$(a).qvd] (qvd)

 

 

Thanks

Labels (1)
1 Solution

Accepted Solutions
rubenmarin

Hi, you can create a Dual value using the Dual() function where you can assign a number to each string, in this case it could be:

Dual(WeekName(date),(Year(date)*100)+Week(date))

View solution in original post

1 Reply
rubenmarin

Hi, you can create a Dual value using the Dual() function where you can assign a number to each string, in this case it could be:

Dual(WeekName(date),(Year(date)*100)+Week(date))