Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous Rate

Hi All,

I have one urgent requirement. Requirement is that if Rate of Transport  from 6-7-13 to 13-7-13 is 895 and from 1-7-13 to 5-7-13 is 855.Then I need Previous Rate which is 855. How i find ??

My code is below:

Freight:

LOAD

     FROMDELIVERYPOINTCODE&TODELIVERYPOINTCODE&VEHICLETYPE&Upper(DLVMODEID) as KEY,

     RATE,

     DLVMODEID,

     FROMDELIVERYPOINTCODE,

     TODELIVERYPOINTCODE,

     VEHICLETYPE,

     if(ALE_FREIGHTTYPE=0,'Primary','Secondary') as ALE_FREIGHTTYPE,

     date(EFFECTIVEDATETIME) AS StartDate

FROM

D:\QLIKVIEW_RAWDATA\ALE_FREIGHTTABLE.QVD

(qvd)Where DATAAREAID=100 and YEAR(EFFECTIVEDATETIME)<>1900;

Right Join("Freight")

Load

*,

Date(if(Previous(KEY) = KEY,date(previous(StartDate)-1),date(Today()))) as EndDate,

if(KEY=Previous(KEY),Previous(RATE)) as [Previous RATE]

Resident Freight //Where num(StartDate)<=Date(if(Previous(KEY) = KEY,date(previous(StartDate)-1),date(Today())))

Order By KEY,StartDate Desc;

Please help me out !!

Thanks in advance ..

Regards

Deepak

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Deepak Kindly share the sample file.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi Kaushik,

Please find the file in the updated post.

Regards

Deepak

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Dear Deepak,

     Its hard to find what exactly you are looking from QVW file.

     Kindly guide us what selections to be done and what output you are expecting.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi Kaushik,

You can look in the Updated Post.I explain in the Text Object on the Main Tab.

Regards

Deepak

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the attachment, see the last Tab.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thanks a lot Kaushik it  works !!