Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
paulyeo11
Valued Contributor II

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

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

May be this:

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

5 Replies
paulyeo11
Valued Contributor II

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

my QV Doc

MVP
MVP

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

Maybe try to put the minus directly before the Amount

sum(

{<rEVENUE={rEVENUE}>} -Amount

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

paulyeo11
Valued Contributor II

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

Hi Stefan

Thank you very much for your help again.

Paul

paulyeo11
Valued Contributor II

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

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

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

May be this:

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

Community Browser