Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
First of all I tried searching for this topic did not find it...if there is already one please redirect me to that link.
Problem : I have two columns called sales_increment and profit_increment. I have to calculate the sum of all sales_increment when sales_increment > 0 and profit_increment>0.
I am trying to display the result in a text box.
Expression used :
Sum(If(INCREMENTAL_SALES>'0' and INCREMENTAL_PROFIT>'0',INCREMENTAL_SALES))
I am not getting the right answer. Can anyone please look into this??
Sokkorn,
I have one more doubt here. I loaded the dataset and then changed the dataset...that is deleted some rows from the dataset. To reflect the changes I reloaded it, but I could not observe any changes. Is there any other method to reload the changed data?
Hi,
Let do this expression (with distinct keyword)
=SUM({$<INCREMENTAL_SALES={">0"}, INCREMENTAL_PROFIT={">0"}>} DISTINCT INCREMENTAL_SALES)
***Check your datasource to find duplicate record.
Regards,
Sokkorn
Hi,
After changing the data set..looks like I am getting the correct result
I did not try wiht distinct..because there are no records which are the same
Also, I wanted to know if we can write this condition programtically ie.
if(incremntal_sales > 0 && incremental_profit >)
{
variable = incrmental_sales
}
else
{
variable = variable + incremental_sales
}
If this is possible, how do I write it in Qlikview( i.e where nd the syntax)
Thanks for your help!
Hi,
It seem you want to achieve accumulate incremental_sale. Am I right?
Regards,
Sokkorn
Yes accumulate value for rowa which satify that condition
Sent from my iPhone
On Jun 12, 2012, at 12:39 AM, Sokkorn Cheav <
Hi,
Let try this expression
RangeSum(Above(Total SUM({$<INCREMENTAL_SALES={">0"}, INCREMENTAL_PROFIT={">0"}>} DISTINCT INCREMENTAL_SALES),0,RowNo(TOTAL)))
See sample attached file.
**Can remove distinct if your datasource is ok.
Regards,
Sokkron