Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Sample data please !
here you go
thanks
Sukhwant
A similar calculation is done here: http://community.qlik.com/blogs/qlikviewdesignblog/2013/09/16/counters-in-the-load
HIC
Are you sure the data your have provided are giving the same result you expected in question?
@ 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
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
@ 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
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)))