Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
JordyWegman
Partner - Master
Partner - Master

Challenge #4: Get the total sales for each sales rep on their last day

Challenge #4:

Our company manages sales from our sales reps. In order to see how they are performing at their last day of sale, we want to see those numbers. This means we want the total sales of their sale date for each sales rep. Check the outcome for the numbers that are needed, also the Totals need to be included.

Challenge #4.png

 

If you have a solution, please post this in the comments as other people can learn from your solution!

Work smarter, not harder
Labels (1)
9 Replies
tresesco
MVP
MVP

So you have series of challenges. Are these your problems, or just challenges for others to try out? Coming back to your challenge/issue, I got your sample file attached. What is expected output there now (because I see the numbers are same in your sample and need-to-be screenshot)?

JordyWegman
Partner - Master
Partner - Master
Author

These are challenges for others to try to figure them out!

In the application you can find two tables:

  1. Challenge, this is the data that is needed for the challenge
  2. Outcome, this is outcome that you can use as an reference

The idea is to recreate the outcome table with the data from the challenge table. The challenge in this one is the maximum date of each sales rep while they are not the same.

Work smarter, not harder
tresesco
MVP
MVP

FirstSortedValue( Aggr(Sum(Amount), SalesRep, Date), -Date)

anushree1
Specialist II
Specialist II

Can this be done using aggr or some other way? i tried using aggr but as set analysis works column wise and not row wise , I could not get it working.

 @JordyWegman , Thanks for sharing the challenge its quite fun to attempt something like this

 

JordyWegman
Partner - Master
Partner - Master
Author

Correct, that is also the challenging thing about this! You can check the post of @tresesco .

Work smarter, not harder
tresesco
MVP
MVP

Another solution using set analysis you can try like:

Sum({<Date={"=Date(Aggr(Max(Date),SalesRep))"}>}Amount)

 

anushree1
Specialist II
Specialist II

@tresesco 

Works really well.

Any reason why you have included  Date within the $ sign expansion ? (formatting?)

sum({<Date={"=(aggr(max(Date),SalesRep))"}>}Amount) seems to work fine as well

 

tresesco
MVP
MVP

I never checked that the Date field here was actually numeric. I thought a date field would have date format values, and to be on the safer side if format comes into spoil the expression, I just added to make it safe-working.

By the way, there is no $ sign expansion here.

JordyWegman
Partner - Master
Partner - Master
Author

Hereby the solution!

Work smarter, not harder