Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
apoorvasd
Creator II
Creator II

Multiple week selection on opening a QlikView report

Hello Everyone,

I am trying to set up a trigger which selects weeks until previous week (i.e., current week -1) by default when a user opens the report. Can anyone help me with the expression for this?

I tried the following, but it isn't working as expected.

='("' & Concat(Weeks-1, '"|"') & '")'

Any help on this?

Thank you.

4 Replies
developer90210
Contributor II
Contributor II

Hi,

Not quite sure if this is what your after but have you tried something like:

='>='& date((max(WhateverYourDateFieldIs)-6),'DD/MM/YYYY')

Regards

Craig

apoorvasd
Creator II
Creator II
Author

Hi Craig,

Thanks for your suggestion.

I need multiple selections to be made in field, "Week" and not date. Looks like the expression you have provided is for Date field right?

developer90210
Contributor II
Contributor II

Hi,

Yes, it's for date.

Sorry -  I should have read the question properly! 

I think you'd still have similar logic for week field though (untested):

='>='&Week(max(WhateverYourWeekFieldIs)-1)

or if your wanting to retrieve records between two dates/week you could have (untested):

='>='&Week(max(WhateverYourWeekFieldIs)-10)  & '<='&Week(max(WhateverYourWeekFieldIs)-1)

Having said that, it's probably easier for me since the date fields I need are already created as part of the load so I only need to use the "Date" field to manipulate them.  (Eg  Load *, date(Floor(StartDate)) as Date,Week(StartDate) as StartWeek, WeekName(StartDate) as StartWeekYear from Table1 etc)

Not sure if the above helps or hinders! 

apoorvasd
Creator II
Creator II
Author

Hello,

Thanks a lot!

But the expressions didn't work for me. I would want all the weeks (week 1 to current week -1) to be selected by default when I open the report.

='>='&Week(max(WhateverYourWeekFieldIs)-1), output of this expression was 4. Not sure how!


Do you have any other suggestion?

Thank you.