Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
manideep78
Partner - Specialist
Partner - Specialist

Alternate states in expression

Dear Community,

I want to put the below expression in alternate states like

Original Expression:

=RangeSum($(='Sum(['&GetFieldSelections(Item,']),Sum([', 999999)&'])'))

using Alternate states:

=RangeSum($(='Sum({AS_NoSel * $}['&GetFieldSelections(Item,']),Sum([', 999999)&'])'))


I tried the second expression, But not giving the exact result.

What's wrong in the 2nd expression?

Is there a way we can put that expression in alternate states?

Thanks in advance.

Regards

Manideep

31 Replies
manideep78
Partner - Specialist
Partner - Specialist
Author

I tried this earlier, when I select an item from list box, the sum is giving 0.

manideep78
Partner - Specialist
Partner - Specialist
Author

Yes, what ever I select from list box, I should get like the above expression,

Ball --> Sum({AS_NoSel * $}Ball)

Pen --> Sum({AS_NoSel * $}Pen)

Ball & Pen --> Sum({AS_NoSel * $}Ball)+Sum({AS_NoSel * $}Pen)

sunny_talwar

Lets go back to the basics. You have two list boxes for item, 1st in default state and 2nd in AS_NoSel, right? Based on your selection in both the list boxes you want to show the sum of items which are common in the two list boxes? Is that what you are trying to do?

manideep78
Partner - Specialist
Partner - Specialist
Author

The above expression in working when placing in text box, but it is not filtering out in the chart.

sunny_talwar

Can you check what do you get when you do

RangeSum(Sum({AS_NoSel * $}Ball), Sum({AS_NoSel * $}Pen))

Then try this:

=RangeSum($(='Sum({AS_NoSel * $}['&GetFieldSelections(Item,']),Sum({AS_NoSel * $}[', 999999)&'])'))

and select Ball and Pen from the item list box. Do you get a different number or a 0??

manideep78
Partner - Specialist
Partner - Specialist
Author

No Sunny, I will have only 1 list box which is in default state.

I have 2 charts overlapped.

The front chart shows the actual values based on the selections from list box. it is in alternate state.

Since, the front chart is in alternate state and all the filters including the item filter are in default state, we use alternate state in set analysis like {AS_NoSel * $}.

The back chart will show the entire data to look like as it was a set reference functionality.

The front chart was in alternate and the back chart was in normal state because, if i select a dot from the top chart is should not effect in the second chart and will look like the set reference functionality

manideep78
Partner - Specialist
Partner - Specialist
Author

i am getting a Different number. when I place the above expression in text object, it is working fine. But when I put that expression in grid chart, it doesn't shows any difference.

sunny_talwar

Can you recreate the chart from scratch?

manideep78
Partner - Specialist
Partner - Specialist
Author

I did it no luck.

sunny_talwar

‌I am not home right now, but I promise to help you once I return. I think I need to start from the basics again.