Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
shyamcharan
Creator III
Creator III

Derived calculation issue

Hi Experts,

I am trying to use the below formula to get slope in a text box.

=Linest_m(Total Aggr( rangesum(Above(Total sum(X),0,RowNo(Total))),$(test)), $(test))

test:

$(test)=$(CostChartStartDate)+Y*7

Here Y is Age, so basically i am adding age to the start date and multiplying with 7 because the age units is weeks.

to derive into days i have to multiply age * 7 days  and add this to start date.

CostChartStartDate:

$(CostChartStartDate) = 01/02/2009

In the slope formula when i give a normal date field from database it works fine but when i use this derived formula it does not work.

Any idea please help. It is same with many calculations where it does not work for the variables that have the formulas.

Thanks in advance.

Shyam.

6 Replies
Not applicable

Hi,

Usually data are a bit annoying... Have you try to format the variable in date?

$(test)= date( $(CostChartStartDate)+Y*7 ,'DD/MM/YYYY')



shyamcharan
Creator III
Creator III
Author

Hi Filippo,

Thanks for your response.

Yes I have tried that and no luck. not sure what i am missing.

Thanks in advance.

Shyam

shyamcharan
Creator III
Creator III
Author

Hi,

Any help here please. Just to get the variables work is killing me.

Now I have used a different approach. Rather adding the age to date i just used the Age field because I just need slope and the chart what i have designed works but now getting this work in text box is having issue

nothing shows up.

tresesco
MVP
MVP

Try like:

=Date(Date#($(CostChartStartDate), 'DD/MM/YYYY')+Y*7)

shyamcharan
Creator III
Creator III
Author

Hi all,

Thank you very much for your suggestions.

However, I had no luck with your suggestions. It looks like the linest_m function does not go well with the $() variables.

Appreicate any other suggestions or help on this.

Thanks in advance.

Regards,

Shyam

shyamcharan
Creator III
Creator III
Author

Hi Experts,

Here is what i am able to get for more information. Attached is the QVW file that i am working and now i wanted to display the slope of the lines in a text box or in some sort of table.

I used the below formula but it break when i used the multiplication operator like *(i guess) for my report scenario

Linest_m(Total Aggr(Y2,X2), X2)

Can some one please help me get the slopes for this

I am struggling with this since 2 weeks and its been embrasing to me a little bit

I appreciate your help on this.

Thanks in advance.

-Shyam