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: 
paulyeo11
Master
Master

SET expression change from sum(sales) to rEVENUE return null

Hi All

I have below expression work fine :-

SUM(sales)

I manage to conver to from sales field to rEVENUE , it work fine :-

Sum(

{<rEVENUE={rEVENUE}>}Amount

)

I also have below expression work fine :-

sum(-sales*YearToDate(date, year-Year(Today())))/1000

I try to convert it from sales to rEVENUE , it return null :-

sum(-

{<rEVENUE={rEVENUE}>}Amount

*YearToDate(date, year-Year(Today())))/1000

Can some one advise me where go wrong ?

Paul

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Sum(Aggr(-Sum({<rEVENUE={rEVENUE}>} Amount)/1000/Rate * Sum({<rEVENUE={rEVENUE}>}YearToDate(date, year-Year(Today()))), year, date))

View solution in original post

5 Replies
paulyeo11
Master
Master
Author

my QV Doc

swuehl
MVP
MVP

Maybe try to put the minus directly before the Amount

sum(

{<rEVENUE={rEVENUE}>} -Amount

*YearToDate(date, year-Year(Today())))/1000

paulyeo11
Master
Master
Author

Hi Stefan

Thank you very much for your help again.

Paul

paulyeo11
Master
Master
Author

Hi Stefan

After i change the -ve sign to infront of Amount , it does able to display the bar.

sum(

{<rEVENUE={rEVENUE}>}-Amount

*YearToDate(date, year-Year(Today())))/1000

But i just notice that the figure display is wrong , i excepted to get 158 for Bar 2016 now i get 2057

I try to move the -ve sign around , i still can not make it work :-

sum(

{<rEVENUE={rEVENUE}>}Amount*-1

*YearToDate(date, year-Year(Today())))/1000

sum(

{<rEVENUE={rEVENUE}>}Amount

*YearToDate(date, year-Year(Today())))/1000*-1

Can you advise me ?

Paul

sunny_talwar

May be this:

Sum(Aggr(-Sum({<rEVENUE={rEVENUE}>} Amount)/1000/Rate * Sum({<rEVENUE={rEVENUE}>}YearToDate(date, year-Year(Today()))), year, date))