Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
brunopaulo
Partner - Creator II
Partner - Creator II

Set Analysis Using alternate states

Hello Community,

I found the extension to Qlik Sense to use Alternative states.

In the Example they show this way

Sum(Sales) - For main group

Sum({Alt} Sales- for comparison group.

I already created the group but i have a doubt.

I want to do this

Sum({$<Year={'$(vMaxYear)'}>} Sales) for main group

=Sum({Alte}{$<Year={'$(vMaxYear)'}>} Sales) - for comparison group

Anyone can help me in syntax?

thanks in advance

Bruno Paulo

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Sum({Alte<Year={'$(vMaxYear)'}>} Sales)

View solution in original post

10 Replies
sunny_talwar

Try this

=Sum({Alte<Year={'$(vMaxYear)'}>} Sales)

brunopaulo
Partner - Creator II
Partner - Creator II
Author

And just complicating a bit

=Sum({$<Year={'$(vMaxYear)'}>} Sales)

/

Sum(Total{$<Year={'$(vMaxYear)'}>} Sales)

and

=Sum({Alte<Year={'$(vMaxYear)'}>} Sales)

/

Sum(Total{Alte<Year={'$(vMaxYear)'}>} Sales)

the second one is wrong can u help me?

Thank you for the perfect anwser on the 1st one.

Regards

Bruno

sunny_talwar

Looks right.... can you share the image of what you getting with both the expressions?

brunopaulo
Partner - Creator II
Partner - Creator II
Author

I'm getting 100% on second expression

sunny_talwar

You have year as your chart dimension?

brunopaulo
Partner - Creator II
Partner - Creator II
Author

Isn't a bar chart its a KPI object

sunny_talwar

TOTAL qualifier does nothing in a KPI object... so you are basically dividing the same number in the numerator by the same number in the denominator to get 1 (or 100%)... what is the goal here?

brunopaulo
Partner - Creator II
Partner - Creator II
Author

I know, but when i select a customer or a product the KPI should give me the percentage of that customer or product in total sales, but when i select it keeps give me 100%

sunny_talwar

Try this

=Sum({Alte<Year={'$(vMaxYear)'}>} Sales)

/

Sum({Alte<Year={'$(vMaxYear)'}, Customer, Product>} Sales)