Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
capriconuser
Creator
Creator

obtained / total values in textbox

I have data in sheet like this

productsobtainedtotal
p1120010000
p2100020000
p320030000
p1120010000
p2140020000
p3600

30000

here if i get sum of products then p1 shows 2400 p2=2400 and p3=800 .. so here i get 2400 top value against twp products ..

so i want to get top values in textbox and want like this in textbox

p1 (2400/10000)  p2 (2400/20000)

how i do this ?

19 Replies
capriconuser
Creator
Creator
Author

OK this work properly but  WILL you please why you use rank .. and will you please explain your whole query

i unable to understand

MK_QSL
MVP
MVP

I used concat function to concatenate

product, sum of obtained and sum of total.

rank i have used to get only top 2 products...

to learn comprehensive set analysis, enrol my below course on udemy.

https://www.udemy.com/become-an-expert-of-qlik-set-analysis/learn/v4/overview

capriconuser
Creator
Creator
Author

only top 2 products? what if we have more than 2 then ? we suppose not to do that manually change rank ...

MK_QSL
MVP
MVP

This is your question

so here i get 2400 top value against twp products ..


So I considered you need top 2. Let me know what is the logic you want.. I can suggest new expression accordingly.

capriconuser
Creator
Creator
Author

means this is not necessary that only two products i gave only example here .. this may be more than 2 also or may be 1 or may be 3 means ..

rest is same only here i try to clear that this is not necessary only two products may be these is 4 products with same values

MK_QSL
MVP
MVP

when you are saying 2 products, 3 products... but what is the logic of showing them on text box..

right now you are showing 2 products out of 3 ... so why you are showing only 2 and not all 3..

what is the logic?

are you showing only those products which are crossing 2400 ???

if yes the use

=Concat({<products = {"=SUM(obtained)>=2400"}>}DISTINCT Aggr(products & '  ' & '(' & SUM(obtained) & '/' & SUM(Distinct total) & ')',products),CHR(10))

capriconuser
Creator
Creator
Author

want to show those who have highest values .. or if there is 2 or 3 or so on  product with same highest values than want to show accordingly

MK_QSL
MVP
MVP

then use this..

=Concat({<products = {"=SUM(obtained) = Max(TOTAL Aggr(SUM(obtained),products))"}>}DISTINCT Aggr(products & '  ' & '(' & SUM(obtained) & '/' & SUM(Distinct total) & ')',products),CHR(10))

capriconuser
Creator
Creator
Author

thanks so much

MK_QSL
MVP
MVP

you can also use

=Concat({<products = {"=Rank(SUM(obtained),1,1)=1"}>}DISTINCT Aggr(products & '  ' & '(' & SUM(obtained) & '/' & SUM(Distinct total) & ')',products),CHR(10))