Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. April 17 - 20, 2023, in Las Vegas! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
ibradly
Contributor III
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.

Labels (6)
1 Reply
Anil_Babu_Samineni

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)