Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
tomcatxx
Creator
Creator

show percent value for selected date

Hi, there.

Help! Thank you.

I have field Product (A, B and C) and Date (many days). For example, I want to see how much is the sales proportion of A for today in a Text box. So I select a product  A and a date in List box. But it dose not work with following script

=Num(Sum(Sales) / Sum({<%Date = GetFieldSelections(%Date)>} Sales), '#,#0.0%')

Further more,

If I don't select a product, it shows 'Please select a product and a date'.

=if(GetSelectedCount(%Date) = 1 and GetSelectedCount(Product) = 1 , Num(Sum(Sales) / Sum({<%Date = GetFieldSelections(%Date)>} Sales), '#,#0.0%'), 'Please select a product and a date')

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi

if you want the proportion of product A sales today in regard to all product A sales use

sum(Sales)/Sum({<Date>}Sales)

if you want the proportion in regard to all products sales in today use

sum(Sales)/sum({<Product>}Sales)

View solution in original post

2 Replies
lironbaram
Partner - Master III
Partner - Master III

hi

if you want the proportion of product A sales today in regard to all product A sales use

sum(Sales)/Sum({<Date>}Sales)

if you want the proportion in regard to all products sales in today use

sum(Sales)/sum({<Product>}Sales)

YoussefBelloum
Champion
Champion

you can try this:

=Num(Sum(Sales) / Sum(total {1} Sales), '#,#0.0%')