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: 
miranrai
Contributor III
Contributor III

total of sales based on one dim in table and with selection of other dim total should not change

I have a table as below. My requirement is to get total sale by product . If i select order date = 9/8/2019, then total sale by product =34*12 and Total sale to date by product = total (total sale by product ) = 2259 and this number should not change with selection (but record should reduce as per selection . I hope this explains. 

Thank you for help.

attaching excel for reference.

Productorder datelogistic dateproduct idorder duration namedescriptionsaleTotal Sale by ProductTotal sale to date by product 
112/12/202016/07/2020a123abcabc122762259
112/12/202018/07/2021a212xyzxyz344082259
19/8/201916/07/2021a135abcabc4515752259
29/9/201918/07/2022a376pqrpqr65494011780
29/10/201916/07/2022a490lmnlmn76684011780
39/11/201918/07/2023a123abcabc2352950864
39/12/201916/07/2023a345pqrpqr45202550864
39/13/201918/07/2024a245xyzxyz6542943050864
39/14/201916/07/2024a456lmnlmn2341310450864
39/15/201918/07/2025a276xyzxyz76577650864
Labels (1)
3 Replies
Kushal_Chawda

@miranrai  is it not 45*35 for 9/8/2019 as per the data?

miranrai
Contributor III
Contributor III
Author

@Kushal_Chawda  yes ..expression for Total Sale by Product = order duration * sale and Total sale to date by product = sum of Total Sale by Product by each product. sample excel you can refer

Kushal_Chawda

@miranrai  try below expressions

//Total Sale by Product
=sum({1}[order duration]*sale)*avg(1)

//Total sale to date by product 
=sum(total <Product>{1}[order duration]*sale)*avg(1)

 

Annotation 2020-09-06 120646.pngAnnotation 2020-09-06 120722.png