Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
sass
New 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
MVP & Luminary
MVP & Luminary

Re: Date -1 on selected field

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
MVP & Luminary
MVP & Luminary

Re: Date -1 on selected field

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

sass
New Contributor

Re: Date -1 on selected field

Thank you !!