Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I not familiar in Qliksense and need help on below logic.
basically i have populate 'Difference' column in table (not in report). To find the 'Sales difference' by calculating Today's 'Sales Amount' minus Yesterday's
'Sales Amount' to generate the column 'Difference' as attached in data table. and it has to be by
SaleID, Desc, Reported Date and Sale Date. for more details please find the attached sample data excel. where it has excel formula to populate 'Difference' column.
Thanks & Regards
Loga
Use Sum(Sale Amount) as a measure, name it Amount, then use this formula:
Amount - Above(Total Amount, 1, 1)
Hi Lisa,
Thanks for your effort. but i want this to be created in table means in 'edit script' as a field. and its has to grouped by Reported date and SaleID.
Use previous or peek function to pick previous value
Hello!
To do it in the script, let’s assume you have loaded your table as Table 1, then:
Table2:
Noconcatenate Load
SaleID,
Desc,
[Reported Date],
[Sale Date],
[Sale Amount],
if(SaleID=peek(SaleID) and [Reported Date]=peek([Reported Date]), [Sale Amount]-peek([Sale Amount]),[Sale Amount]) as Difference
Resident Table1
Order by SaleID,[Reported Date],[SaleDate];
Hope this helps!