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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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 !!