Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
RaviPuttaswamy5
Partner - Contributor III
Partner - Contributor III

Qliksense Development

hello,

Please take reference of the below table, as of now I'm calculating the Previous Quantity using previous function in script which is fetching the previous row value, but required is need to get the previous Quantity based on product like 7LB bag quantity should fall inline with previous 7Lb bag Quantity.

have attached the excel, where column E is Required Output, Column D is existing logic using previous function.

Thanks in Advance.

Regards,

 

 

 

Labels (2)
1 Reply
Mario_De_Felipe
Luminary
Luminary

Hi @RaviPuttaswamy5,

you could get it in the load script:

 

[Sheet1]:
LOAD
[Ticktes],
[Date],
[Quantity],
[Previous Quantity(Current Logic)],
[Required Output(Previous Quantity based on Product)],
[Productname]
FROM [lib://_Descargas_/exercise1.xlsx]
(ooxml, embedded labels, table is Sheet1);


Table1:
LOAD
if(previous(Productname)=[Productname],previous(Quantity),'') as PreviousQTY,
[Ticktes],
[Date],
[Productname]
RESIDENT Sheet1
order by [Productname],[Date] ASC;

Hope it helps;