Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mhmmd_srf
Contributor

Dynamic Dinominator

Hi All,

I have denominator in division calculation like below:

RangeSum(Value) /

((4*Count (distinct PLANT)) - Count({<Dates1 = {"$(=Date(Date#('$(vDATE)','M/D/YYYY') - 7))","$(=Date(Date#('$(vDATE)','M/D/YYYY') - 14))","$(=Date(Date#('$(vDATE)','M/D/YYYY') - 21))","$(=Date(Date#('$(vDATE)','M/D/YYYY') - 28))"} >}Dates))


But my chart is behaving wrongly. However If we plot the same expression of denominator in Single KPI, it returning a correct numeric value.

Can you please help.

Thanks,

Sarif

10 Replies
vinieme12
Esteemed Contributor II

Re: Dynamic Dinominator

can you post a sample app that demonstrates the issue

Preparing examples for Upload - Reduction and Data Scrambling

MVP
MVP

Re: Dynamic Dinominator

May be you can try with Sum() instead of RangeSum().

mhmmd_srf
Contributor

Re: Dynamic Dinominator

no I need to use RangeSum.

My issue is if keep 6 or 7 as numeric, it is working fine. But when the same thing I am trying to replace with the expression like below, then the chart is messing up.

((4*Count (distinct PLANT)) - Count({<Dates1 = {"$(=Date(Date#('$(vDATE)','M/D/YYYY') - 7))","$(=Date(Date#('$(vDATE)','M/D/YYYY') - 14))","$(=Date(Date#('$(vDATE)','M/D/YYYY') - 21))","$(=Date(Date#('$(vDATE)','M/D/YYYY') - 28))"} >}Dates))


Could you please help.

Thanks,

Sarif

MVP
MVP

Re: Dynamic Dinominator

Could you post your sample qvw? Try putting your denominator under dollar expansion like : $ ( <denominator>)

mhmmd_srf
Contributor

Re: Dynamic Dinominator

Not working sir... 

MVP
MVP

Re: Dynamic Dinominator

Ok, $ expansion is not working, what about sharing your sample qvw?

mhmmd_srf
Contributor

Re: Dynamic Dinominator

Hi Tresesco,

I am attaching the qvf file. Please check the last sheet. That is Order, Delv Line Cnts with Avgs_Holidays_V2.

Please check and help.

Thanks,

Sarif

gowtham_patnaik
New Contributor II

Re: Dynamic Dinominator

As you mentioned that

if you are using denominator as expression then it is working.

Try this:

Div(RangeSum(Value),((4*Count (distinct PLANT)) - Count({<Dates1 = {"$(=Date(Date#('$(vDATE)','M/D/YYYY') - 7))","$(=Date(Date#('$(vDATE)','M/D/YYYY') - 14))","$(=Date(Date#('$(vDATE)','M/D/YYYY') - 21))","$(=Date(Date#('$(vDATE)','M/D/YYYY') - 28))"} >}Dates)))

MVP
MVP

Re: Dynamic Dinominator

My earlier sense installation is somehow not working. Could you post a qvw or I am not sure when could I get a chance/enough time for re-downloading the latest sense and install.