Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

need expression help

Hi all,

have 2 month data of stocks and their closing prices. objective is to derive how many days closing price has increased from its previous day and throw the number of days in an expression in straight table. below is the desired output:

Stocks     No of days upticks from previous day

IBM          10

GOOG      5

MS           20

Please let me know way forward

thanks,

Sukhwant

8 Replies
MK_QSL
MVP
MVP

Sample data please !

Not applicable
Author

here you go

thanks

Sukhwant

hic
Former Employee
Former Employee

MK_QSL
MVP
MVP

Are you sure the data your have provided are giving the same result you expected in question?

Not applicable
Author

@ Manish - data provided is different from desired result in Question. point is to get an idea on how to make an expression based on the data provided

@ Henric - thanks for the response, but that article suggests solution by amending the script. i want to explore if this can be handled in dashboard only by not touching script.

thanks,

Sukhwant


Anonymous
Not applicable
Author

Hi,

if(previous(STOCKS)=STOCKS and previous(CLosing_Price) < CLosing_Price, RangeSum(1,Peek(No_of_Days_Count)), 1) as No_of_Days_Count

Write the above code in the script and use the field as an expression in the Chart

Not applicable
Author

@ Karthigayan - as mentioned earlier, dont want to amend the script. will appreciate if can get a solution in the dashboard expression only

thanks in advance

Sukhwant

Anonymous
Not applicable
Author

Try with this expression:

=if(Stocks=Only({<Datefield={'=$(=Date(Datefield-1,'MM/DD/YYYY')})'>}Stocks) and CLosing_Price=Only({<Datefield={'=$(=Date(Datefield-1,'MM/DD/YYYY')})'>}CLosing_Price),

RangeSum(Above(No_of_Days_Count,1,1)))