Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dafnis14
Specialist
Specialist

Expression with Different Alternate States doesn't work

Hi,

The following expression references different alternate states.

But it doesn't work, i.e., it doesn't take into account the actual selections.

sum ({<Date=State2::Date,Country=Country1::Country,Branch=Branch1::Branch>}Quantity)

Can someone help?

Thanks!

1 Solution

Accepted Solutions
dafnis14
Specialist
Specialist
Author

Hi,

I have managed to resolve my issue.

1. I have defined a state for the document.

2. For relevant list boxes I have defined states.

The expression that works as expected is the following:

sum({State1<Date=$::Date,Country=p(Country),Branch=p(Branch)>}Quantity)

View solution in original post

7 Replies
Gysbert_Wassenaar

The syntax is correct. Can you post a document that demonstrates the problem?


talk is cheap, supply exceeds demand
CELAMBARASAN
Partner - Champion
Partner - Champion

You meant that it doesn't considers the default state selections?

dafnis14
Specialist
Specialist
Author

Right. It ignores the selections.

I have defined a state for the sheet, and left only 2 states for listboxes.

Using this expression takes into account selection in a branch, as expected, but not the date:

sum({<Date=State1::Date,Country=$::Country,Branch=$::Branch>}Quantity)

It seems there is an issue with such a syntax:

State2::Date

Thanks!

dafnis14
Specialist
Specialist
Author

Hi,

The original document is huge.

But I think there is a clue which might help:

The list box with the defined state has a Branch Description field to select .

But the expression is including the field Branch, which is the linked code to the Branch Description.

Before alternate states, the set analysis expression worked fine:

sum ({<Date=p(Date1), Country=p(Country1),Branch=p(Branch1)>}Quantity)

Do you have an idea how this can be implemented with alternate states?

Thanks!

Gysbert_Wassenaar

sum ({<Date=p(Date1), Country=p(Country1),Branch=p(Branch1)>}Quantity)

If this works then Date1, Country1 and Branch1 are not alternate states but fields. Or have you defined alternate states with those names as well?


talk is cheap, supply exceeds demand
sakamsureshbabu
Creator
Creator

HI

my dimension  is ornament but i want show in pivot table with selected "brand"

condition is "BRAND=Y"

how can i show

dafnis14
Specialist
Specialist
Author

Hi,

I have managed to resolve my issue.

1. I have defined a state for the document.

2. For relevant list boxes I have defined states.

The expression that works as expected is the following:

sum({State1<Date=$::Date,Country=p(Country),Branch=p(Branch)>}Quantity)