Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
bruno_m_santos
Partner - Creator
Partner - Creator

Is possible to use alternate States with set analysis

Hello,

I'm new with alternate states.

It's possible to use alternate states (ie use Group1) with a set analysis syntax as below? Can you give a sample please?

=Count({$<MonthID = {"<=$(=Max(MonthID))"},
Date = {"<=$(=Max(Date))"},
Year = {$(=Max(Year))},
Quarter = ,
Period = ,
[Period (#)] = ,
Month = >}Operacoes_DetalheKey)


Many Thanks

Bruno

13 Replies
Not applicable

Your first two 'e.g's in blue seem to have the closing curly bracket in the wrong place?

Shouldn't it be:

e.g. sum({Group1  <Year=$::Year> } Sales)

e.g. avg({MarketDev <Year={BaseLine}::Year,Category={Global}::ProductCategory> SalesLeadTime

With closing curly bracket just before the final field_name that you wish to aggregate, such as Sales or SalesLeadTime.

Not applicable

Can we have conditional?

Means

ex.

I have global filter Brand,Country, Yardstick.

and One alternate state.

I want to change data in alternate state by using Yardstick where yardtick is radio button b/w R3M, YTD, Month.

Can we have this type of set analysis in if condition?

saveriospa
Partner - Contributor III
Partner - Contributor III

Hi Michael.

Your tip was very helpful to solve my problem too !!


I've another question .... starting from this expression (i've defined an alternate state "StateB"):


sum({<KPI={'Production'},Period=StateB::Period, Quarter=StateB::Quarter, Month=StateB::Month>} Actual)


If i need to filter Month for the maximum Month selected, how can i do?



Many Thanks!!

Saverio

Anonymous
Not applicable

Hi,

i have similar problem:

=Sum({$<MO_ID={21}, Rok = {$(=only('20'&(Left([Rok-Miesiąc],2)-2)))}, Miesiąc={"<=$(=Max(Right([Rok-Miesiąc],2)))"}, [Rok-Miesiąc]=>}KwotaW

I tried to do this like that:

=Sum({$[stan1]<MO_ID={21}, Rok = {$(=only('20'&(Left([Rok-Miesiąc],2)-2)))}, Miesiąc={"<=$(=Max(Right([Rok-Miesiąc],2)))"}, [Rok-Miesiąc]=>}KwotaW

but it doesnt work.

Maybe i should set stan1 for all fields, so for Rok, Miesiąc, Rok-Miesiąc?

stan1 is connected with field Rok-Miesiąc.

Please help me,

Best Regards,

Jacek Antek