Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
chrismtb
Creator
Creator

display just a calculated total in a text box from a table

Hi,

I have a data set currently set out similar to the below example (but with a lot more depth to the information). I have a number of dashboards which query the data in different ways and provide a number of views.

One of the views i had required me to pull out where i had duplicated Ref ID's but only in the cases where the status was valid (in this case all valid statuses contain " - ".

Sys IDRef IDStatusNameDescription
1123451 - planproject aproject info
2543212 - buildproject bproject info
3111122 - buildproject cproject info
412457rejected reason aproject dproject info
54 - concludedproject eproject info
6123452 - buildproject fproject info
712345funding deniedproject gproject info

I used the below logic to come up with a simple table view that works:

=IF(wildmatch([Status],'*-*'),IF([Ref ID]>0,IF(count([Ref ID])>1,count([Ref ID]),),))

which allows me to exclude both where there is not a valid status and where there are blank Ref IDs... IE using the example table i would expect to return results with a total at the bottom:

Ref IDCOUNT
123452
2

(this result is Sys ID 1 and 6)

As previously mentioned i added a number of other views to look at other requirements and decided the best way to look at things was a high level summary tab.

For this i have a text box with the condition for each table and then another text box with the total for that condition.

I am stuck though because i want to display the total from the results table (directly above) in this text box.

I have tried using another count/sum statement around my formula to get the result i.e.

=sum(IF(wildmatch([Status],'*-*'),IF([Ref ID]>0,IF(count([Ref ID])>1,count([Ref ID]),),)))

but this just does not work plain and simple.... can anyone give me some direction as how to solve this (i suspect it involves set analysis of some sort but i have quite a bit going on in the formula and can't get it clear in my head!)

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Count(Aggr(If(WildMatch([Status],'*-*'), If([Ref ID]>0, If(Count([Ref ID]) > 1, Count([Ref ID])))), [Ref ID]))

or

Sum(Aggr(If(WildMatch([Status],'*-*'), If([Ref ID]>0, If(Count([Ref ID]) > 1, Count([Ref ID])))), [Ref ID]))

View solution in original post

2 Replies
sunny_talwar

Try this:

Count(Aggr(If(WildMatch([Status],'*-*'), If([Ref ID]>0, If(Count([Ref ID]) > 1, Count([Ref ID])))), [Ref ID]))

or

Sum(Aggr(If(WildMatch([Status],'*-*'), If([Ref ID]>0, If(Count([Ref ID]) > 1, Count([Ref ID])))), [Ref ID]))

chrismtb
Creator
Creator
Author

I used the second version (the sum) and it works perfectly - Thanks Sunny T