Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
prahlad_infy
Partner - Creator II
Partner - Creator II

Help my data to limt on the user fed date . Please help .

Helo Seniours ,

I want to show only those data in my table which is of last week to the date selected by me plus next week data

last week data-UserFeddate-Nextweek data .

Thank you in advancing .

1 Solution

Accepted Solutions
tresesco
MVP
MVP

The problem arises because you are referencing inter-year weeks. For such cases, you should rather use date field along with perhaps weekstart(), weekend() like:

Sum({<DateE={">=$(=Date(WeekStart(vDateselected,-2),'DD/MM/YYYY')) <=$(=Date(WeekEnd(vDateselected,2),'DD/MM/YYYY'))"}>}Sales)

View solution in original post

12 Replies
isingh30
Specialist
Specialist

You have to specify some date range. Like, start & end date in your expression.

Like this - ('>=' & '01/01/2010' & '<=' & '31/12/2012') it's just a sample syntax.

Thank you!

ashishbhuyekar
Contributor III
Contributor III

Are you doing any aggregration on top of these date selection? if yes, the i would suggest to go ahead with set expression using something like this, below expression is for the previous week -

=SUM({<Week = {">=$(=Max(Week(Selected date))-1)"}>} Sales)

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

I use varibale vDateselected to accept date from user and i want to fetch all the sales and date which happened 14 days earlier to this date plus 14 days later to this date


can you share expression with use of this variablea

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

sureshqv‌ . Please help Sirs

Chanty4u
MVP
MVP

you want to display last 7days and next 7 days sales ?

tresesco
MVP
MVP

Try like:

Sum({<DateE={">=$(=Date(vDateselected-14)) <=$(=Date(vDateselected+14))"}>}Sales)

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

two different reqrimnt Sir

1) last 14 days and next 14 days

2) for ex if the  week of date selected by user is 3 then

                   sale of 3 week plus sale of 1&2 week plus sale of 4&5 week

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

thank Sir ..

Reaal requrment is below

1) last 14 days and next 14 days

2) for ex if the  week of date selected by user is 3 then

                   sale of 3 week plus sale of 1&2 week plus sale of 4&5 week

Sorry for mine weak english

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

Sir , your expression


Sum({<DateE={">=$(=Date(vDateselected-14)) <=$(=Date(vDateselected+14))"}>}Sales)


is pulling sales data for year 2017 as well


but  user date is 19/1/2018 so


as per your exp its should to pull data from date range 5 jan 18 to 2 feb 2018