Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sass
Contributor
Contributor

Date -1 on selected field

Hello,

I am trying to get set analsyis to give me the day before selected day by user.

This set analysis is working : 

Sum({<[MasterCal.Day]={'$(=GetFieldSelections([MasterCal.Day]))'}>} sales)

Sum({<[MasterCal.Day]={'$(=max([MasterCal.Day]))'}>} sales)

But when I want to add -1, it doesn't work...

I tried this but it doesn't work...

Sum({<MasterCal.Day={"=$(=GetFieldSelections(MasterCal.Day))-1"}>} sales) or Sum({<[MasterCal.Day]={'$(=max([MasterCal.Day])-1)'}>} sales)

Can any one fix this please.

1 Solution

Accepted Solutions
marcus_sommer

Try it with:

Sum({<[MasterCal.Day]={"$(=date(max([MasterCal.Day])-1), 'Format')"}>} sales)

Format must be the format from [MasterCal.Day].

- Marcus

View solution in original post

2 Replies
marcus_sommer

Try it with:

Sum({<[MasterCal.Day]={"$(=date(max([MasterCal.Day])-1), 'Format')"}>} sales)

Format must be the format from [MasterCal.Day].

- Marcus

sass
Contributor
Contributor
Author

Thank you !!