Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vignesh_s
Creator
Creator

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

23 Replies
Anil_Babu_Samineni

Is this you are expecting?

Capture.JPG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
shiveshsingh
Master
Master

try this..

Test:LOAD * INLINE [

    Date, Qty/Nv, level, Rate

    28/12/18 , 11.2, , 3

    27/12/18 , 22.2, 40, 4

];

new:

load Date, [Qty/Nv], level,

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;

vignesh_s
Creator
Creator
Author

exactly

vignesh_s
Creator
Creator
Author

Can i get the expression fr this?

and sorry for late reply

vignesh_s
Creator
Creator
Author

Thanks for ur reply bbut this is nt my exceptation

vignesh_s
Creator
Creator
Author

hi can u please share ur expression please

Anil_Babu_Samineni

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..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

May be like attached

Capture.PNG

Anil_Babu_Samineni

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Yes, sorting of the chart will be a key here