Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
ibradly
New Contributor III

Highest sales for a given day in a week

I am trying to get the highest sales for a given day in a week by campaign.

Ex: Monday: $10,000, Tuesday $15,000, Wednesday $7000 etc.. For each campaign that I have i want to pull Tuesday's sales because that is the highest sale for that week.

Right now I am able to get the highest sales for the last day of the week by using the max date function. 

if(sum({$<[GA Campaign]=,EmailCampaignYorN={'Email'}>}[Unique Opens]) / sum({$<[GA Campaign]=,EmailCampaignYorN={'Email'}>}Deliveries)>0,
SUM({<EmailCampaignYorN={'Email'},Date={'$(=max(Date))'}>}[Transaction Revenue]),NULL())

I am not sure how to approach this. I also attached a picture. 

Also, you can ignore the if function this is just to get rid of some nulls.

1 Reply

Re: Highest sales for a given day in a week

May be create Week field from Date field like

Week(DateField) as Week

and, use expression as

if(sum({$<[GA Campaign]=,EmailCampaignYorN={'Email'}>}[Unique Opens]) / sum({$<[GA Campaign]=,EmailCampaignYorN={'Email'}>}Deliveries)>0,
SUM({<EmailCampaignYorN={'Email'},Date={'$(=max(Week))'}>}[Transaction Revenue]),NULL())

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)