Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YTD and Set Analysis

User selects 2010 in a list box and March in another list box. I need a chart (straight table) that in one column show March's total sales and in the second column shows YTD sales.

Seem to be brain dead today

Help,

Stephen

1 Solution

Accepted Solutions
Not applicable
Author

If you are forcing them to select a month, then that is all you would need for March.

For YTD, why don't you just use set analysis and turn off the month selection - keeping all else the same. (assuming your month field is just Month)

Sum({$<Month=>} yourAmount)

$ = current selections

<Month=> = removes Month selection

ws

View solution in original post

11 Replies
Not applicable
Author

By the way, the user also selects a territory from a list box.

Not applicable
Author

If you are forcing them to select a month, then that is all you would need for March.

For YTD, why don't you just use set analysis and turn off the month selection - keeping all else the same. (assuming your month field is just Month)

Sum({$<Month=>} yourAmount)

$ = current selections

<Month=> = removes Month selection

ws

johnw
Champion III
Champion III

I think this:

March 2010 = sum(Sales)
March 2010 YTD = sum({<Month={"<=$(=Month)"}>} Sales)

Not applicable
Author

wshpuntoff worked.

Thanks.

Not applicable
Author

Hi wshpuntoff

Can this be done in a Cyclic Group? If yes then please help me out!

Thanks

Attitude

Not applicable
Author

Hi John

Can it be done used as one of the field along with Year/Quarter/Month/Week. If it can be done then please let me know on that.

Regards

Attitude

Not applicable
Author

You can use the function GETCURRENTField and pas your Cyclic group Name.

Not applicable
Author

Thanks asomani! This is something similar to what I was looking for but not very sure whether it give the expected result or not.

Could you please give me more detail on how to use this inside the Cyclic Group please.

Are you expecting me to do something like below? For your information as "getcurrentfield" gives the field which is selected in the group I have passed '=''' for the YTD. Hope I am doing the right thing here. If not please do let me know.

if(getcurrentfield(MyGroup)='=''',Count({<[Month] =, [Year] = {'$(vMaxYear)'}>} ID),Count(ID))
Not applicable
Author

Correct. Now based on this you know what Column you viewing and what expression you should be consider

Regards,

Amit