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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vijetas42
Specialist
Specialist

Text object Expression

Hi all,

I need you help in below scenario,

I am having columns WEEK and Sales

Week, Sales

    W1, 100

    W2, 299

    W3, 90

    W4, 300

    W5, 500

    W6, 100

    W7, 50

    W8, 90

    W9, 60

    W10, 157

    W11, 290

    W12, 350

    W13, 650

If I select W1,W2,W3 from Week list in my first text box it shows me W1,W2 and W3 and in other it should show me W4,W5,W6 how to write an expression for the same.

Likewise,If I select only W1 then it should show me W2 in second text box.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like attached qvw?

PFA

View solution in original post

8 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Do these weeks have underlying numerical values? Without numbers it will be pretty difficult to write such an expression.

vijetas42
Specialist
Specialist
Author

Hi,

Can you explain underlying numerical values as in ?

tresesco
MVP
MVP

If one selects W2 and W5 - what would be the expected output in both the cases?

vijetas42
Specialist
Specialist
Author

Hi,

User will not select Weeks in random order he will select weeks in continuous order.

tresesco
MVP
MVP

May be like attached qvw?

PFA

Peter_Cammaert
Partner - Champion III
Partner - Champion III

In your example data, weeks are identified by way of text strings. In a typical QlikView Calendar, weeks are numerical (e.g. 1-53) but can be displayed as W1...W53. However, the underlying value stays numerical, whatever the output format.

Numerical weeks are easier to work with, especially in set analysis.

vijetas42
Specialist
Specialist
Author

Hi treseco,

Thanks for your reply.It works fine.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

With numerical weeks, you can show the next batch with this expression:

=Sum({<Week = {'>$(=Max(Week)<=$(=Max(Week)*2+1-Min(Week)+)'}>} Sales)