23 Replies Latest reply: Jan 17, 2018 2:18 AM by Vignesh S

# Chart function

Hi all i have problem in chart calculation

for 1st row of calculation i.e., for date 28/12/18 which is a dummy record joined with the fact table so for

each fund(a,b,c....) the 28/12/17 were added, for all funds with 28/12/17 as 1st row and calcualtion i need is (Qty/nv)*Rate and

from 2nd row and above (above of calulation field) /(1+Coresponding level field values)

ex:

Date      Qty/Nv      level      Rate      Value(Calculation)

28/12/18 11.2                          3          11.2*3=33.6          (only for 1st row i.e., for date 28/12/18 calculation (Oty/nv)*Rate)

27/12/18 22.2          40          4          33.6/(1+40)=0.81  from 2nd and above the calculation is (Above(Value)/(1+coresponding level)

26/12/18 32              50          6          0.81/(1+50)=0.66          continue as above..........

.....                              60

...

..

'Value' field is an expected output

• ###### Re: Chart function

Better if you provide sample?

• ###### Re: Chart function

ya i will

• ###### Re: Chart function

the table is nt propor i thnk , i will repost it

ex:

• ###### Re: Chart function

Please provide sample data? At least few rows in excel

• ###### Re: Chart function

here i attached the excel file of it,

• ###### Re: Chart function

How long this rows got Break? What if you have 100 Rows with Different Rows? Can u explain relate the Live data as well..

• ###### Re: Chart function

Actually i cant tel the exact data its confidential ,i have fund field wchic conatind 120 funds in it ,each fund end with 28/12/17

so for each fund for date 28/12/18 calculation must be Price *star ,the date is arranged in ascending order

from 27/12/18 the calculation is

 i.e.,previous value of Calculation part divided by (1+coresponding level value )

its quit triky i thnk,but hope u understoad my requiment now atlest

• ###### Re: Chart function

We can use If..Else condition, But it's long process to achieve. Instead if you make 10 Rows and expected result that would give right way..

• ###### Re: Chart function

oh

ok i have attached excel with 10 records can u give me the solution,i want expression for chart

• ###### Re: Chart function

Is this you are expecting?

• ###### Re: Chart function

exactly

• ###### Re: Chart function

Can i get the expression fr this?

• ###### Re: Chart function

I haven't tried this in my QVW? I've applied this in excel itself. But, I tried now. For me it is not working. But interesting to follow.

Note - If possible, Try to make that calculation field in excel itself rather Qlik. Anyway, We would love to understand the scenario. Let's see if stalwar1 helps..

• ###### Re: Chart function

May be like attached

• ###### Re: Chart function

Haha, Sunny i forget to sort Text for date field? That is the reason the values are not visible. Liked It !!!

• ###### Re: Chart function

Yes, sorting of the chart will be a key here

• ###### Re: Chart function

Thanks alot Sunny and Anil,its working

but last changes i need ,After Calculation ,i wanna hide values for date 28/12/17, the entir row should b hideded

• ###### Re: Chart function

I've update from Sunny example. May be look attached

• ###### Re: Chart function

Try this expression

=If(RowNo(TOTAL) = 2, Above(TOTAL Rate*Price)/(1+Level), Above(TOTAL Exp)/(1+Level))

• ###### Re: Chart function

Thanks a lot ,its working

• ###### Re: Chart function

try this..

Date, Qty/Nv, level, Rate

28/12/18 , 11.2, , 3

27/12/18 , 22.2, 40, 4

];

new:

Rate,RowNo() as Flag

Resident Test

order by Date desc;

drop table Test;

Final:

load Date,level,[Qty/Nv],Rate, if(Flag=1, [Qty/Nv]* Rate,Previous(([Qty/Nv]* Rate))/(1+level)) as Calculation

Resident new;

drop table new;

• ###### Re: Chart function

Thanks for ur reply bbut this is nt my exceptation