Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Lunar Week

Hi i have written below code. iam getting expression error with Lunar week.

LOAD

Year(`DATE`) as year,

Month(`DATE`) as month,

LunarWeek(`DATE`) as week;

FROM Total;

Can anyone help ??



1 Solution

Accepted Solutions
Not applicable
Author

You can try concatenate


LOAD Year(DATE) as year
Month(DATE) as month
Year(DATE) &'/'& Week(DATE) as week
FROM Total;


View solution in original post

10 Replies
Not applicable
Author

Hi,

The function is LunarWeekName or LunarWeekStart or LunarWeekEnd.

Not applicable
Author

Hi Tonial

I tried the LunarWeekStart &LunarWeekName in my script, but iam not getting the correct values.

I got the values like this :

38169

38640

38647

38697

.

.

.

.

40445

Any suggestion ????

Many thanks

matt_crowther
Luminary Alumni
Luminary Alumni

Those values are raw date formats - simply format them to dates (=date(Field)) - put '40445' in an Excel cell and then set the format to be a date...you get 24/09/2010.

Hope that helps,

Matt - Visual Analytics Ltd

Not applicable
Author

Hi Matt

Thanks for your reply.

As you suggested, i have changed the format to date and i got values like this :

01/07/2004

15/04/2005

.

.

.

24/09/2010

But I want to see lunar week as numbers like 1,2....52.

when i wrote the script with week(date) as week, it's giving week values like 1,2....53, but when i used lunarweekname(date) as week, its giving values like 01/07/2004 etc., How can i change that format to numbers ????

Not applicable
Author

HI,

I agree with Matt's response.

I tried and it worked well.

LunarWeekName ( '01/12/2011' ) Date Format is MM/DD/YYYY return 2011/02.

put your code here.

Not applicable
Author

Here is my code:

LOAD Year(`DATE`) as year

Month(`DATE`) as month

LunarWeekName(`DATE`) as week ;

FROM Total;

As per suggestion, I have changed 'week' list box properties to---number---date ----DD/MM/YYYY, return values are 01/07/2004,15/05/2005 etc……but I want 1,2,3…52.

Many thanks

Not applicable
Author

You Trys this, without quotes.


LOAD Year(DATE) as year
Month(DATE) as month
LunarWeekName(DATE) as week
FROM Total;


Not applicable
Author

Hi Tonial

Tried without quotes, but still returning same values as mentioned above.

Any other solution please ??

Thanks

Not applicable
Author

You can try concatenate


LOAD Year(DATE) as year
Month(DATE) as month
Year(DATE) &'/'& Week(DATE) as week
FROM Total;