Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
vijetas42
Specialist
Specialist

Incorrect dates are getting displayed

Hi ,

I have scenario where I have data as below,

  

DATETestNumValue
2015091152-0.09958
2015091853-0.01105
2015092554-0.14401
20151002550.14401
20151009560.05528
20151016570.07742
20151023580.09958
2015103059

-0.11465

here, TestNum I have taken Autonumber based on date and sorted dates asc

here I am showing data for last 8 weeks date based on selected date.

Selected date is 20151030

from TestNum i have calculated current week as only(TestNum) and prior8week as only(TestNum)-7

now, I have calculated value also highest value and min value based on 8 week range but, now,

i have to display date corresponding to max value in textbox and same for minimum

in this, case my maxdate should be 20151002 and mindate should be 20150925.

Can some one help

1 Solution

Accepted Solutions
sunny_talwar

May be this

FirstSortedValue({<TestNum = {">=$(=only(TestNum)-7)<=$(=only(TestNum))"}>} DATE, -Aggr(Sum({<TestNum = {">=$(=only(TestNum)-7)<=$(=only(TestNum))"}>} Value), DATE))

FirstSortedValue({<TestNum = {">=$(=only(TestNum)-7)<=$(=only(TestNum))"}>} DATE, Aggr(Sum({<TestNum = {">=$(=only(TestNum)-7)<=$(=only(TestNum))"}>} Value), DATE))

View solution in original post

4 Replies
sunny_talwar

May be this

FirstSortedValue({<TestNum = {">=$(=only(TestNum)-7)<=$(=only(TestNum))"}>} DATE, -Aggr(Sum({<TestNum = {">=$(=only(TestNum)-7)<=$(=only(TestNum))"}>} Value), DATE))

FirstSortedValue({<TestNum = {">=$(=only(TestNum)-7)<=$(=only(TestNum))"}>} DATE, Aggr(Sum({<TestNum = {">=$(=only(TestNum)-7)<=$(=only(TestNum))"}>} Value), DATE))

View solution in original post

vijetas42
Specialist
Specialist
Author

It's showing me the same date which I have selected

vijetas42
Specialist
Specialist
Author

It's working when I excluded selected date field. Thank you!!

vijetas42
Specialist
Specialist
Author

Hi Sunny,

I am facing an issue with firstsortedvalue() below expression.Now, I am having two same values for different dates but, in this case I should get latest date.

So., I have used distinct in firstsortedvalue() but, it seems sometimes working and sometimes not.

Could you please suggest on the same.