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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Harry12
Contributor
Contributor

Iteration or Permutation ?

Hi guys,

Sorry for the newbie question. I had this following table

 Sale
12/2/20191
12/3/20192
12/4/20195
12/5/20199

Need to show the day over day progress :

 SaleD1D2D3
12/2/201912.005.009.00
12/3/201925.009.00 
12/4/201959.00  
12/5/20199   
4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think the best approach may be using the Below() function as a chart expression.

The expression for D1 would be:

alt(below(Sum(Sale),1), '')

and for D2

alt(below(Sum(Sale),2), '')

Alternatively, you could generate D1/D2 etc in the script, but I would need to know if there are multiple rows per date or a single row per date. 

The attached qvw demonstrates both techniques. 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Harry12
Contributor
Contributor
Author

Thanks Rob for the reply. Greatly appreciated.

Harry12
Contributor
Contributor
Author

Hi Rob,

If I had multiple records on the same day, such as

  SalesD1D2D3
12/2/2019Store 11356
12/2/2019Store 224 7
12/3/2019Store 1356 
12/3/2019Store 24 7 
12/4/2019Store 156  
12/5/2019Store 16   
12/5/2019Store 27   

 

Do I need to load each store into each own table so I can do RecNo properly ?

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, Sorry for the delayed response. If you have multiple rows per date, then you first need to group by date, either in a resident load or in the initial load. 

LOAD F1 as BaseDate,
    
Sum(Sales) as Sale
FROM
[https://community.qlik.com/t5/QlikView-Scripting/Iteration-or-Permutation/td-p/1654352]
(
html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @3)
Group By F1
;

Example attached. 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com