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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot table dates range display problem

hi folks,

i have data from 2012 jan 1-29 days.

 

my problem is to show the dates range as 1-7  8-15  16-23   like that

i tried calculated dimension as--   date(weekstart(salesdate),'m.dd')&'-'& date(weekend(salesdate),'m.dd')

expression: sum(sales)

problem: its showing dates range from 26-1,1-8.....23-29.

requirement: range should start from 1st day of january

may be its problem in date format , i used subfield to achieve the desire date format

where exactly the problem

plz help me out

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Please refer to attachment.

View solution in original post

15 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

If you use WeekStart it returns the Week starting date For Jan-1, the week start is 26-1.

Try this using

date(Lunarweekstart(salesdate),'m.dd')&'-'& date(Lunarweekend(salesdate),'m.dd')

Hope this helps you

Regards,

Jagan.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Use this expression instead of the above, Date Format is fixed.

=Date(Lunarweekstart('1/1/2012'),'M.DD') &'-'& date(Lunarweekend('1/1/2012'),'M.DD')

Regards,

Jagan.

Not applicable
Author

hi jagan,

thanks for ur reply

lunarweekstart solved problem , but last week range its showing 1-29  to 2-4 .

any alternative to restrict week range up to end of january

Thanks

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi You can use:

=Date(Lunarweekstart('1/1/2012'),'M.DD') &'-'& If(date(Lunarweekend('1/1/2012'),'M.DD')<7,

date(MonthEnd('1/1/2012'),'M.DD'),date(Lunarweekend('1/1/2012'),'M.DD'))

Not applicable
Author

hi ,

if i use max date as variable  ,ie:  date(max(Date), 'DD MMM YYYY').

how can i use my variable in this expression to achieve only january 1st  to 29th

expression working on the use of transdate dimension only.

plz help me out

jagan
Partner - Champion III
Partner - Champion III

Hi,

try using the below expression

=Sum({<Transdate={'>=$(=MonthSart(vDate))<=$(=MakeDate(Year(vDate), Month(vDate), 29))'}>} Sales)

Regards,

Jagan.

Not applicable
Author

hi jagan,

here vDate=max date or min date

how i can declare vDate as Variable.

here date starting from jan 1 to 29.

thanks jagan

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Press Ctrl+Alt+V.

     In variable overview you can add variables.

     add variable name as vDate.

     value as =Max(Date)

Celambarasan

Not applicable
Author

Hi,

Try inserting following dimension.

(TestDate need to be replaced by SalesDate / whatever dimension you have).

IF(MONTH(LunarWeekEnd(TestDate))<>MONTH(LunarWeekStart(TestDate)),NULL(),LunarWeekStart(TestDate)&'-'&DATE(LunarWeekEnd(TestDate),'DD/MM/YYYY'))

This will give you range of date before Jan end only.