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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
chematos
Specialist II
Specialist II

expression issue

Hi,

I need help with this expression:

sum({$<NumPeriodo={'<=$(NumPeriodo)'},%KeyPeriodo={"=%KeyPeriodo"}>}Promedio)

I thought that this would work but is wrong. First of all, I have this fields:

NumPeriodo: Period`s number, being 01 for August and 11 for July.

PERIODO: Is compossed by Year+NumPeriodo, for example August 2010 would be 201001

%KeyPeriodo: This is an ID to identify the periods so 1 identify the periods of 2010(August2010 to July2011), 2 = (Aug2011 - July2012) , etc.

When the user selects a PERIODO, for example 201107 (Year 2011, NumPeriodo 07) I need to add all the values of Promedio since NumPeriodo=01 to NumPeriodo = 07. The %KeyPeriodo would be 2 for all that periods.

Help me, please.

Thank's,

Chema

1 Solution

Accepted Solutions
chematos
Specialist II
Specialist II
Author

Hi,

I tried with sum({$<NumPeriodo={"<=NumPeriodo)"}>}Promedio) but it didn't work.

This expresion is working finally!!

sum({$<NumPeriodo={'<=$(=NumPeriodo)'}>}Promedio)

View solution in original post

3 Replies
chematos
Specialist II
Specialist II
Author

I'm a little desperate. Why if I create a textObject and I write =NumPeriodo, I get 07 which type is a Number and when I write the next expressions the result is different??

sum({$<NumPeriodo={"<=07"}>}Promedio)  ----> Working fine!

sum({$<NumPeriodo={"<=NumPeriodo"}>}Promedio)  ----> Working wrong!

Could someone explain to me?Any clue?


m_woolf
Master II
Master II

Unless I'm missing somthing:

NumPeriodo={"<=NumPeriodo"}   asking if NumPeriodo is less than or equal to itself.

chematos
Specialist II
Specialist II
Author

Hi,

I tried with sum({$<NumPeriodo={"<=NumPeriodo)"}>}Promedio) but it didn't work.

This expresion is working finally!!

sum({$<NumPeriodo={'<=$(=NumPeriodo)'}>}Promedio)