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: 
gauthamchilled
Creator
Creator

Ignoring dimension for one expression and including for other

I have dimension like this =Aggr([CustomerName],ProfitID)

and I have two expression 1 is sum(sales) and

2nd is sum({<{ Period='$(=max(Period)-1)'}>} Sales)

My requirement is i want to use =Aggr([CustomerName],ProfitID) dim for 1st expression and for second expression

i want to use just CustomerName

how can i do this?

Thanks

Gautham

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be this?

Sum({<Customerid=p({<RT_ID={"=Len(Trim(RT_ID))>0"}>}),Period={'2016'}>} Sales)

View solution in original post

10 Replies
Anil_Babu_Samineni

May be these two

1) Aggr(Sum(Sales), [CustomerName], ProfitID)

2) Aggr(sum({< Period= {'$(=max(Period)-1)'}>} Sales),[CustomerName])

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Would you be able to share 3-4 lines of sample data and show what you want to see as an output?

gauthamchilled
Creator
Creator
Author

Hi Sunny,

PFA for the sample data and requirement.

sunny_talwar

May be try this instead of your current approach

Capture.PNG

gauthamchilled
Creator
Creator
Author

Hi Sunny,

Thanks for the reply, But if i clear the selection, it brings all the customerids.

Capture.JPG

Requirement is to bring the sales for

1st expression. Customer ids which also have RT ids (for current year)

2nd expression. same customer ids of previous year (even though RT ids are not there for previous year)

Thats why i used aggr function with RT ids, but 2nd expression returns 0 values becuase rtp id is not there for year 2015. 

gauthamchilled
Creator
Creator
Author

Is it possible to lookup the first column customer ids and show its sum of sales in second column??

1st column customer ids are based on RT ids but 2column customerids are based on 1st column but not on RT ids.

gauthamchilled
Creator
Creator
Author

Modified the example and explained my requirement little more clearer...please help.

gauthamchilled
Creator
Creator
Author

any one have idea? how to use one dimension for first expression and ignore that for second expression?

tresesco
MVP
MVP

May be this?

Sum({<Customerid=p({<RT_ID={"=Len(Trim(RT_ID))>0"}>}),Period={'2016'}>} Sales)