Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III
Creator III

Issue with bucket creation

Hi Community,

I'm facing issue with bucket creation, can you please help me.

Data:

CountrySalaryBase SalRevenue
IND50020001200
IND1200300200
IND250300700

I have different calculations, like below....

CountryBucketCalculation
INDBASESalary/Revenue
BENEFIT(Salary-Base Sal) / Revenue
BONUS(Revenue-Base Salary) / Revenue

if i select India, have to show below..

2020-11-11_14-02-33.png

Thanks in Advance!

Labels (1)
3 Replies
Taoufiq_Zarra

@paulwalker  May be :

in dimension

=Valuelist('BASE','BENEFIT','BONUS')

 

and in measure

=Pick(Match(Valuelist('BASE','BENEFIT','BONUS'),'BASE','BENEFIT','BONUS'),
sum(Salary)/sum(Revenue),
(sum(Salary)-sum([Base Sal]))/sum(Revenue),
(sum(Revenue)-sum([Base Sal]))/sum(Revenue)
)

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
paulwalker
Creator III
Creator III
Author

I have huge data,  is there any possibility script level ??

Taoufiq_Zarra

@paulwalker  If I understood correctly you can do also in script:

Data:
LOAD * INLINE [
    Country, Salary, Base Sal, Revenue
    IND, 500, 2000, 1200
    IND, 1200, 300, 200
    IND, 250, 300, 700
];

Tmp:

load Country,sum(Salary)/sum(Revenue) as BASE,(sum(Salary)-sum([Base Sal]))/sum(Revenue) as BENEFIT,(sum(Revenue)-sum([Base Sal]))/sum(Revenue) as BONUS resident Data group by Country;

Final:
CrossTable(Measure, Data)
LOAD * resident Tmp;

drop table Tmp;

and then in UI

Dimension is Measure Field

and Expression sum(Data) for example

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉