Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
retko1985
Creator II
Creator II

Restrict showing data when other data are not available

Hello,

I have a situation when we receive one file and it is planned for the future, so numbers are for the whole month. But now in the calculations these numbers are appearing, and I want to restrict this.

My calculation is very simple, like this:

=sum(Sales_Amount)-

sum(Discount_Amount)

Sales are coming for the previous day, but discounts are for whole month. (they are not discounts, it just an example).

Now my bar chart is rising till today, and falling for the rest of the month, because I am substracting 0 - discount.

I know I might use if (sum(Sales_Amount) <> 0 ... But is this the correct solution?

Should I use some set analysis or something?

And How.

Thank you.

1 Solution

Accepted Solutions
sunny_talwar

The if statement should be fine too... but you can try this

=Sum(Sales_Amount) - Sum({<Date = {"=Sum(Sales_Amount) <> 0"}>}Discount_Amount)

or this

=Sum(Sales_Amount) - Sum({<Sales_Amount = {"*"}>}Discount_Amount)

View solution in original post

7 Replies
tresesco
MVP
MVP

You could probably use set analysis like:

=sum({<Date={'<=$(=Today())'}>} Sales_Amount)-

sum({<Date={'<=$(=Today())'}>} Discount_Amount)

Anil_Babu_Samineni

Can we talk related more about Dataset?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

The if statement should be fine too... but you can try this

=Sum(Sales_Amount) - Sum({<Date = {"=Sum(Sales_Amount) <> 0"}>}Discount_Amount)

or this

=Sum(Sales_Amount) - Sum({<Sales_Amount = {"*"}>}Discount_Amount)

retko1985
Creator II
Creator II
Author

1 expression gives Exceeded memory allocation.

2 is doing nothing.

Thank you.

retko1985
Creator II
Creator II
Author

With this solution all my bars dissapear, the week from the beginning of the Year.

Thank you.

sunny_talwar

Do you have a Date field? I mean what is your chart dimension/s?

retko1985
Creator II
Creator II
Author

Ok, this helps. I am using working day. So after I put this, it seem correct.

Thanks.