Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
robinwiman
Creator
Creator

Set Expression with time modifier

I have the following expression:

Sum (if ((Year = CurrentYear) and (Week <= ($(VECKANRTMP)+10)), SalesBudEUR))


And I want to turn it into a set expression instead. But I'm not sure about how to integrate the +10 modifier.

1 Solution

Accepted Solutions
stigchel
Partner
Partner

Try with

=Sum ({<Year = {$(=CurrentYear)}, Week={"<=$(=VECKANRTMP+10)"} >} SalesBudEUR)

View solution in original post

7 Replies
Anil_Babu_Samineni

I am assuming, These are variables? Perhaps this?

Sum ({<Year = {$(CurrentYear)}, Week={"<=($(VECKANRTMP)+10)"} SalesBudEUR)

OR

Sum ({<Year = {$(CurrentYear)}, Week={"$('<=' & VECKANRTMP+10)"} SalesBudEUR)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
robinwiman
Creator
Creator
Author

CurrentYear and VECKANRTMP are both variables, yes.

Unfortunately, the solutions you provided does not work. It shows no data at all.

Perhaps I should explain my question further:

The Sum (if ((Year = CurrentYear) and (Week <= ($(VECKANRTMP)+10)), SalesBudEUR))is a sum of the annual budget for the current year (Year = CurrentYear) and then displaying the budget per week in a bar chart for the coming 10 weeks (Week <= ($(VECKANRTMP)+10)).

Anil_Babu_Samineni

My bad, I missed $ sign here, May be?

Sum ({<Year = {$(=CurrentYear)}, Week={"<=$(=VECKANRTMP)+10)"} SalesBudEUR)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
robinwiman
Creator
Creator
Author

Still no luck

I tried to close the expressions as well:

Sum ({<Year = {$(=CurrentYear)}, Week={"<=$(=VECKANRTMP)+10)" >} SalesBudEUR)

stigchel
Partner
Partner

Try with

=Sum ({<Year = {$(=CurrentYear)}, Week={"<=$(=VECKANRTMP+10)"} >} SalesBudEUR)

View solution in original post

robinwiman
Creator
Creator
Author

There we go!

It works as intended - Thanks a lot. Also big thanks to @Anil Babu!

stigchel
Partner
Partner

A good tip for debugging these kind of problems is to create a straight table  where you leave the label for the expression blank. The header of the table will diaplay how the $ sign expansions are evaluated like

Debug$inSet.png