Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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())

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful