Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

RutiTaumanRubin
Contributor

Help with calculating measure

Hi,

I create measure with the following calculate:

sum(if($(V_SUM)=1,SALES,0)) / sum(COMP)

But the result is not correct.

Any Idea?

Thank you.

6 Replies
RutiTaumanRubin
Contributor

Re: Help with calculating measure

The variable V_SUM define as following:

SET V_SUM ="if(TYPE = 'A – A',1,0)";

Chanty4u
Esteemed Contributor III

Re: Help with calculating measure

try with single quotes

sum(if('$(V_SUM)'=1,SALES,0)) / sum(COMP)

MVP
MVP

Re: Help with calculating measure

What does the variable V_SUM contain?

What do you mean by "not correct"? Is it returning a null value - not returning any value or is it just a wrong number?

RutiTaumanRubin
Contributor

Re: Help with calculating measure

Thank you for your response

I have tried as you suggest but it didn't work ...

RutiTaumanRubin
Contributor

Re: Help with calculating measure

Hi,

Thank you for your response,

The variable V_SUM define as following:

SET V_SUM ="if(TYPE = 'A – A',1,0)";


it's return number , but wrong number.

satheshreddy
Contributor III

Re: Help with calculating measure

Hi Ruti,

Can you please share the sample file to understand your data and we will give some ideas to over come this issue.

Regards

Sathish