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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

conditional sum

hello

i have a table like this:

idmonthd dayF Sr Net Sales Amount
11255000
2126200
323600
4272500
5292000

user asks to show him the last day sale in the month selected

i scripted like this< but it has some errors:

Sum ({< [d Day]= MaxString ([d Day]) >} [F Sr Net Sales Amount])

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try:

Sum ({< [d Day]= {"$(=Max([d Day]))"} >} [F Sr Net Sales Amount])

View solution in original post

7 Replies
tresesco
MVP
MVP

Try:

Sum ({< [d Day]= {"$(=Max([d Day]))"} >} [F Sr Net Sales Amount])

senpradip007
Specialist III
Specialist III

Try this:

Sum ({< [d Day]= {'$(=Max([d Day]))'} >} [F Sr Net Sales Amount])

ashfaq_haseeb
Champion III
Champion III

Try below

Sum ({< [d Day]= {'$(=Max([d Day]))'} >} [F Sr Net Sales Amount])


Regards

ASHFAQ

MK_QSL
MVP
MVP

Create a straight table

Dimension

month

expression

=FirstSortedValue(DISTINCT Aggr(SUM([F Sr Net Sales Amount]),month,[d day]),-[d day])

You will have a syntex error for above expression, but just ignore it... You will have your answer...

Not applicable
Author

Hi Manish ,

  Your Solution in working fine. I also tried solving it using this expression

 

  =Sum({<[d day]={'=Aggr(Max([d day]),month)'}>}[F Sr Net Sales Amount])

But it is  giving the incorrect Result

Answer is Like

Month , Sales

1 , 5000

2 , 600

I am not able find , why Result is coming like this

Thanks and Regards,

Vivek

Not applicable
Author

thank you,

well what would it be if i want this as the condition:

d Day <= A

"A" is something i get as the input

ashfaq_haseeb
Champion III
Champion III

Try below

Sum ({< [d Day]= {'<=$(=Date(Max([d Day])))'} >} [F Sr Net Sales Amount])


Regards

ASHFAQ