Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am trying to Qlik-ify an Excel table that has calculated field. I have a transaction date, a quantity called "out", and I am trying to calculate something called "outbound" where I sum the "out" column from 30 days before the transaction date up to and including the transaction date.
I am looking to code this column in Qlik Sense and don't know how to do it. Any help would be greatly appreciated. I've been trying to work along the following lines
Script
Table: LOAD TransactionDate, "In", Out FROM [lib://Lib/Qlik Sense example.xlsx] (ooxml, embedded labels, table is Data); AsOfTable: LOAD TransactionDate as AsOfDate, Date(TransactionDate -IterNo() + 1) as TransactionDate, -IterNo() + 1 as Flag Resident Table While IterNo() <= 31;
Table
Dimension
AsOfTable
Expression
Sum(-Out)
I suggest you to use The As Of Table for this requirement.
Thank you for your response. I understand the scripting and it looks good. However I am confused as to how to adapt this for a 30 days period, instead of a rolling month?
If you are able to share some sample data with the expected output, we might be able to help you better here
Please let me know if this screenshot is sufficient. I have a table in Qlik Sense, of which below is an extract. I have outlined the row with Transaction Date 30/04/2010. The column I am trying to calculate, Outbound, is the sum of Out between the Transaction Date of 30/04/2010 and 30 days previous, which is 31/03/2010. Therefore 53,405 is the sum of the column "Out", highlighted in gold. As we move up or down the rows, the condition on Outbound is the same, where it is the sum of Out between the Transaction Date of the row and 30 days before that Transaction Date.
I won't be able to upload a screenshot to create a sample... would you be able to provide the Excel file?
Script
Table: LOAD TransactionDate, "In", Out FROM [lib://Lib/Qlik Sense example.xlsx] (ooxml, embedded labels, table is Data); AsOfTable: LOAD TransactionDate as AsOfDate, Date(TransactionDate -IterNo() + 1) as TransactionDate, -IterNo() + 1 as Flag Resident Table While IterNo() <= 31;
Table
Dimension
AsOfTable
Expression
Sum(-Out)
That is brilliant - many thanks!