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: 
ashok1203
Creator II
Creator II

Issuing on Triggers

Hi All,

I have two data island tables in my data model. In that tables i have a 'ID' field in Table1 and 'Number' field in the Table2. Both are different. some of the data are matching. I have given a trigger for auto selection of these two values.

For Example if i select ID value as 1 then it will selects the Number value 1 in Table2. This is working fine for me. But if i select the ID as 5 that value is not there in the Number Field i.e. Table2. On that case the all the data is showing in Table2. But as per the requirement, in that case i need to show only the Empty report instead of showing all the data in table2 ( only headers as report).

Can any one please help on this.

AAK
19 Replies
sunny_talwar

Slight Change in the expression:

If(GetSelectedCount(ID) > 0, Avg({<Number = P(ID)>} 2), 2)

No selection

Capture.PNG

With Selection Part 1

Capture.PNG

With Selection Part 2

Capture.PNG

With Selection Part 3

Capture.PNG

Is this what you want?

ashok1203
Creator II
Creator II
Author

Thanks Sunny. Almost we have reached except one small thing.  If the user selects 11 or 12, In Table 2 we need to show one empty row along with headers.

Capture.PNG

AAK
sunny_talwar

To do that you will need to add another row which is blank to your second table in the script.

ashok1203
Creator II
Creator II
Author

I have added the same, but i am not getting the desired result.

AAK
sunny_talwar

Would you be able to share an updated sample with me? I will need to make some modifications to the expression

ashok1203
Creator II
Creator II
Author

Hi,

Please find the sample attached, do the needful

AAK
sunny_talwar

Check this out:

If(GetSelectedCount(ID) > 0,

If(Count(TOTAL Aggr(Sum({<Number = P(ID)>} 2), Number)) > 0, Sum({<Number = P(ID)>} 2), Sum({<Number = P(ID)+{'-'}>} 2)), 2)

ashok1203
Creator II
Creator II
Author

Hi Sunny, It's working Fine for me as per requirement. Is their any possibility to show the null record with out creating it in the source. I am reading Original data from Oracle Queries that does not contain any Null records.I don't have any scope to create it in the source.

AAK
sunny_talwar

Concatenate the null row through an inline load.

ashok1203
Creator II
Creator II
Author

Thanks Sunny For your Quick Help.

AAK