Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to select the TOP 10% of my entreprises which generate the most revenue.
Today i use this expression :
=if(aggr(Rank(Sum(CA)),DATE_DAY,ENTREPRISE_ID)<=round(count(TOTAL ENTREPRISE_ID)*0.10),Sum(CA))
it work fine if i'm at entreprise_id level but I want a vision by day for do a graph and have a evolution by day
Do you have a solution ?
Thanks in advance
You only have a single dimension (DATE_DAY) in your CA Graph and the expression outputs 2 value... what do you want to do with them? Sum them? Avg Them?.. for Sum you can try this
=Sum(Aggr(If(Rank(Sum(CA)) <= Round(Count(DISTINCT TOTAL <DATE_DAY> ENTREPRISE_ID) * 0.10), Sum(CA)), DATE_DAY, ENTREPRISE_ID))
For Avg
=Avg(Aggr(If(Rank(Sum(CA)) <= Round(Count(DISTINCT TOTAL <DATE_DAY> ENTREPRISE_ID) * 0.10), Sum(CA)), DATE_DAY, ENTREPRISE_ID))
May be try like this:
=if(aggr(Rank(Sum(CA)),DATE_DAY)<=round(count(TOTAL ENTREPRISE_ID)*0.10),Sum(CA))
Thanks for the reply,
I already test this expression and It's not work . it give me the total of the revenue (1476)
Could you please share your expected output, i am not still clear with your requirement.
If you want the list at Date level, then the output will be one value for one date.
hello,
for exemple
20 entreprise ID : 10% = 2 entreprise_iD
I must select the entreprise 7 and 18 because they have the most revenue in the list : total revenue 180
I want only the result of this calcul for each day
I want tell for every day : 10% of my top entreprise generat X % of my revenue
thanks
May be something like this
=Aggr(If(Rank(Sum(CA)) <= Round(Count(DISTINCT TOTAL <DATE_DAY> ENTREPRISE_ID) * 0.10), Sum(CA)), DATE_DAY, ENTREPRISE_ID)
same problem, here my application
You only have a single dimension (DATE_DAY) in your CA Graph and the expression outputs 2 value... what do you want to do with them? Sum them? Avg Them?.. for Sum you can try this
=Sum(Aggr(If(Rank(Sum(CA)) <= Round(Count(DISTINCT TOTAL <DATE_DAY> ENTREPRISE_ID) * 0.10), Sum(CA)), DATE_DAY, ENTREPRISE_ID))
For Avg
=Avg(Aggr(If(Rank(Sum(CA)) <= Round(Count(DISTINCT TOTAL <DATE_DAY> ENTREPRISE_ID) * 0.10), Sum(CA)), DATE_DAY, ENTREPRISE_ID))
Thank you !!! it works perfect
indeed, I forget to add a sum / avg