Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
cafcptg2011
Creator
Creator

set analysis not working on pivot table

Hi,

I need to get the sales before, during and after given promotion, I'm stuck because of my set analysis expression doesn't work properly,

I have this:

c1.PNG

and I need this:

c2.PNG

my set analysis is this:

the before expression is:

=sum({$<   SalesDate = {">=$(=Date(Start-20,'DD-MM-YYYY')) <=$(=(date(Start,'DD-MM-YYYY')))"}>} Qty)

I have my qvw here to help to understand better my pb: http://community.qlik.com/servlet/JiveServlet/downloadBody/7825-102-1-10594/SalesPromotion.qvw

Can someone help me please,

thanks in advance,

CAFC

1 Solution

Accepted Solutions
Anonymous
Not applicable

Try using "if" instead of set analysis:

sum(if(SalesDate>=Start-20 and SalesDate<=Start, Qty))

View solution in original post

5 Replies
Anonymous
Not applicable

Try using "if" instead of set analysis:

sum(if(SalesDate>=Start-20 and SalesDate<=Start, Qty))

Not applicable

Hi,

Please provide the sample data, so that we can help you in better way

@Sub2u

jagan
Luminary Alumni
Luminary Alumni

Hi,

You need to use the If() instead of set analysis, because set analysis calculates at chart level not by row level, so you have use below expression

sum(if(SalesDate>=Date(Start-20,'DD-MM-YYYY') and Date(Start,'DD-MM-YYYY'), Qty))


Hope this helps you.


Regards,

Jagan.

cafcptg2011
Creator
Creator
Author

thanks your solution is correct!

thank you very much for your help!

Cafc

cafcptg2011
Creator
Creator
Author

thanks for help