Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
If you are a Qlik Insight Bot user, join this collaborative group: JOIN GROUP
Highlighted
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
Highlighted
Not applicable

Re: Flags or variables?

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
Highlighted
MVP & Luminary
MVP & Luminary

Re: Flags or variables?

Hi,

     Have a look at the attached file.

Regards,

Kaushi Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
Highlighted
Not applicable

Re: Flags or variables?

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,

Highlighted
Not applicable

Re: Flags or variables?

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

Highlighted
Not applicable

Re: Flags or variables?

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

Highlighted
Not applicable

Re: Flags or variables?

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.

Highlighted
Not applicable

Re: Flags or variables?

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,