Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Frank_Kipry
Contributor II
Contributor II

Formula works not without selection

Hello, I think I have a problem with understanding set analysis properly...

I have 2 dimensions, %Artikel and Datum (material and date) and the formula below.

It works like a charm, when I select one specific %Artikel.

But when I select nothing at all, the result is always 0. (btw, when I select a specific date, the result is also 0 instead of the correct value).

Can you guys help me out where I went wrong? (the picture is just a screenshot of the code)

([Note: The next step is: Min(Aggr(formula, Datum, %Artikel)). in the end I want to see if the predicted inventory goes below 0, in the time intervall today (=vStand) and the lead time (=vStand+WBZ_d)]

//Bestand
Sum({ $< TIMESTAMP_DAY = {"$(=vStand)"}, Datum = {">=$(=vStand)"}>*$<TIMESTAMP_DAY = {"$(=vStand)"}, Datum = {"<=$(=Date(vStand+Only(WBZ_d)))"}>} Menge_Verfuegbar_VBME)
+ Sum({ $< TIMESTAMP_DAY = {"$(=vStand)"}, Datum = {">=$(=vStand)"}>*$<TIMESTAMP_DAY = {"$(=vStand)"}, Datum = {"<=$(=Date(vStand+Only(WBZ_d)))"}>} Menge_Gesperrt_VBME)
//Zukunft
+ Sum({ $< TIMESTAMP_DAY = {"$(=vStand)"}, Datum = {">=$(=vStand)"}, IS_Zugang1_Abgang0_Verlauf = {1}>*$<TIMESTAMP_DAY = {"$(=vStand)"}, Datum = {"<=$(=Date(vStand+Only(WBZ_d)))"}, IS_Zugang1_Abgang0_Verlauf = {1}>} Menge_Bestandsverlauf_VBME)
- Sum({ $< TIMESTAMP_DAY = {"$(=vStand)"}, Datum = {">=$(=vStand)"}, IS_Zugang1_Abgang0_Verlauf = {0}, Art_Bestandsaenderung_Verlauf -= {'gesperrt'}>*< TIMESTAMP_DAY = {"$(=vStand)"}, Datum = {"<=$(=Date(vStand+Only(WBZ_d)))"}, IS_Zugang1_Abgang0_Verlauf = {0}, Art_Bestandsaenderung_Verlauf -= {'gesperrt'}
>} Menge_Bestandsverlauf_VBME)

Labels (2)
6 Replies
Marcos_Ferreira_dos_Santos

Hi Frank_Kipry

Have you solved it by yourself?

This kind of Problem is better understood and dealt with access to the QVW.

Although, it seems that it could be a Null occurency on your data.

 

 

Frank_Kipry
Contributor II
Contributor II
Author

Sadly I can't upload the QVW...

In the end, I used if-statements, which I still would like to replace for performance reasons (I hate loading bars)

But I will try again to search for Nulls, and if I can't find anything I will close this post.

Carlos65
Contributor
Contributor

Thanks for the update and quick reply. I'll be sure to keep an eye on this thread. Looking for the same issue. Bumped into your thread. Thanks for creating it. Looking forward for solution.

payslipview
Contributor
Contributor

I'll be sure to keep an eye on your post . Looking for the same issue. Bumped into your post . Thanks for creating it. Looking forward for solution.

 

 

payslipview

[url=https://payslipview.wiki/]payslipview[/url]
Vegar
MVP
MVP

I noticed some issues in one of @Frank_Kipry's modifiers. 

The Datum modifier  Datum = {"<=$(=Date(vStand+Only(WBZ_d)))"} will not calculate whats expected, He did not provide us with details on vStand variable other than it is todays date, but depending on the variable content Frank would most likely have needed to change the modifier to something like this. 

Datum = {"<=$(=Date('$(=vStand)')+Only(WBZ_d))"}

This was a very specific solution to an old question that most likely is solved by now. Please let me know if this helped you to  solve your specific issue as well @payslipview .

scottmoc
Contributor
Contributor

good information over here, Thanks for sharing the info.

AlaskasWorld