Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

week subtraction

Hi Team,

I have data at yearweek level.

say 201513 which is 13th week for 2015 year.

I want to substract weeks from this . I know it is incorrect to use max(YearWeek)-13. 

Also i know it would have been better to use dual while week creation. but this weeks are already present in the DB ( they have 445 calendar concept).

What is the best way to do it at week level.

Thanks

Khushboo

3 Replies
robert_mika
Master III
Master III

To subtract use

Right(yourfield,2)

if the format is always the same.

antoniotiman
Master III
Master III

Hi,

may be

WeekName(MakeWeekDate(Left(YearWeek,4),Mid(YearWeek,5)),-13)

Regards,

Antonio

Not applicable
Author

in the above scenario, what will happen if the week is first ,

say we have data from 201401 to 201501.

if i minus from 201501 , it will show me incorrect?

How to deal with this?