Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Flags or variables?

Hi,

I need some help and am not sure if I shall use flags or some other practical solution exists. Either ways, I need your advice teaching me how to do it please.

I need to see most recent 3 days' sales in product breakdown and additionally, I would like to see the same for 7 days earlier. I may need to have most recent 3 days and -7 days adjusted based on my selections (or might not need, am not sure yet).

This is what I would like to do with QlikView :

Untitled.png

Attached is the qvw file for your easy reference. (table is in the inline script, no tab elements)

Any advice would be greatly appreciated.

Best regards,

piroglu1907

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Use the below expression:

 

Sum({<DATE = {">=$(=Date(Max(DATE)-6))<=$(=max(DATE))"} - {">=$(=Date(Max(DATE)-5)) <=$(=Date(Max(DATE)-3))"} >}Sales)

View solution in original post

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the attached file.

Regards,

Kaushi 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 Kaushi Solanki,

Thanks for your kind help.

Is there a way that I can show only last 3 days and 7 days earlier data only? If you refer to the excel pivot table I included in my post; I would like to show only 31/7, 4/8,5/8 and 6/8 data. Additionally, can I get their averages to find out average sales?

Best regards,

Not applicable
Author

Hi,

Use the below expression:

 

Sum({<DATE = {">=$(=Date(Max(DATE)-6))<=$(=max(DATE))"} - {">=$(=Date(Max(DATE)-5)) <=$(=Date(Max(DATE)-3))"} >}Sales)

Not applicable
Author

Hi venugopal4s,

Thank you very much, it solved my problem as desired.

Now, how can I get the average of values pertaining to these 4 dates only?

Can you also teach me how I shall interpret your expression? How can I make it independent from selected dates? Just replacing $ to 1? Is this a set analysis expression?

Thanks so much and have a nice day.

piroglu1907

Not applicable
Author

Hi,

I think, that can be possible when we use a variable and store the current max date value. By using this variable in our expression, we can solve the probelm. Please see the attachment.

Not applicable
Author

Hi venugopal4s,

I now understood how you handled the independent dates; thanks so much

Any idea how I can get averages of these 4 records? (most recent 3 dates and also 1 week earlier)?

Best wishes,