Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
durga_bi13
Contributor
Contributor

my date filter -7 days no working n straight table

i have date filter like start date and end date

For Start Date filters are like -7 days and  -21 days

For End date as +7 days and +21 days

 

I have a straight table which contains Product id and year basis sales like sales date, and 2017 sales,2018 sales,2019 sales.

In the straight table sum of year based sales are calculated based on sales date between start and end date.

My expression in straight table

sum({<StartYear ={'$(vLY2)'},TempDate = {"<=$(=Date(max({<StartYear={'$(vLY2)'}>}[End Date])+$(vEnd)))>=$(=Date(min({<StartYear={'$(vLY2)'}>}[Start Date])-$(vStart)))"}>}Sales)

start year- year of start datae

vLY2- Today()-2

 

for filter '-7',  i have three actions

select in field -field name is  [Sales Date] , search in string is   =if(YearPeriod= StartYear,date(min([Start Date])-7))

set variable variable- vStart,  value = 7

select in field - Field is negative which is created on inline basis with value -7

 

In my straight table i get year basis sales between start and end date based on year

if my default min (start date) is 1/1/2018 and my end date with 2/1/2018  it displays records in straight table with this interval for each product

on clicking to -7 , i need to get sales from 12/25/2017. so the sum of values need to get added in existing year based sales.

2 Replies
durga_bi13
Contributor
Contributor
Author

i have date filter like start date and end date

For Start Date filters are like -7 days and  -21 days

For End date as +7 days and +21 days

 

I have a straight table which contains Product id and year basis sales like sales date, and 2017 sales,2018 sales,2019 sales.

In the straight table sum of year based sales are calculated based on sales date between start and end date.

My expression in straight table

sum({<StartYear ={'$(vLY2)'},TempDate = {"<=$(=Date(max({<StartYear={'$(vLY2)'}>}[End Date])+$(vEnd)))>=$(=Date(min({<StartYear={'$(vLY2)'}>}[Start Date])-$(vStart)))"}>}Sales)

start year- year of start datae

vLY2- Today()-2

 

for filter '-7',  i have three actions

select in field -field name is  [Sales Date] , search in string is   =if(YearPeriod= StartYear,date(min([Start Date])-7))

set variable variable- vStart,  value = 7

select in field - Field is negative which is created on inline basis with value -7

 

In my straight table i get year basis sales between start and end date based on year

if my default min (start date) is 1/1/2018 and my end date with 2/1/2018  it displays records in straight table with this interval for each product

on clicking to -7 , i need to get sales from 12/25/2017. so the sum of values need to get added in existing year based sales.

 

 

Brett_Bleess
Support (Former)
Support (Former)

It would be advisable to attach a sample QVW file on this one, so folks can see the data model as well as your expressions etc.  Without that, not sure you are going to get any replies on this one, as folks need that further detail in order to be sure they are offering appropriate possible solutions to things.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.