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

Table to show sum of two different date fields for a given date

Hi All,

I have a requirement wherein we need to have table showing sum of two metrics based on two different dates.

This is the table sample:

   

Date ApprovedTotal
10/13/20172061
10/14/20173062
10/15/20172581
10/16/20171673
10/17/20171878
10/18/20171991
10/19/20172162

where in sum(Total) should be based on the TotalDate field and sum (approved) should be based on another field called Approveddate. and Date in the table is the calendar date.

Kindly let me know if the requirement is unclear.

Thanks,

Anupama Jagan

7 Replies
qlikview979
Specialist
Specialist

not clear.

what is your expected result here ,

-mahesh

Anonymous
Not applicable
Author

The table is the requirement where

Date - to show last 7 days

Approved - sum (Approved) based on Approveddate

Total - sum (Total) based on TotalDate

Approved and Total are two metrics in our application

Kindly let me know if its still unclear

Anil_Babu_Samineni

May be this?

Sum({<Approveddate = {">=$(=Max(Approveddate - 7)) <=$(=Max(Approveddate))"}>} Approved) for Approved

Sum({<TotalDate= {">=$(=Max(TotalDate- 7)) <=$(=Max(TotalDate))"}>} Total) for Total

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

=Sum({<Date = {">=$(=Date(Today()-6,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}} approved)

=Sum({<Date = {">=$(=Date(Today()-6,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}} Total)

or

=Sum({<Date = {">=$(=Date(Today()-6,'MM/DD/YYYY'))<=$(= Date((Max(Date)), 'MM/DD/YYYY')

))"}} approved)

=Sum({<Date = {">=$(=Date(Today()-6,'MM/DD/YYYY'))<=$(= Date((Max(Date)), 'MM/DD/YYYY')

))"}} Total)

Anonymous
Not applicable
Author

The dimension should show today()-7 days..is it possible as calculated dimension?

Anil_Babu_Samineni

I don't recommend to use as calculated dimension

If(Dimenion >= Today()-7 and Dimension <= Today(), Dimension)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Im still not clear about your solution.

Sum({<Approveddate = {">=$(=Max(Approveddate - 7)) <=$(=Max(Approveddate))"}>} Approved) for Approved

Sum({<TotalDate= {">=$(=Max(TotalDate- 7)) <=$(=Max(TotalDate))"}>} Total) for Total

if I use this and dimension as TotalDate , will Approved col show sum for the approved date?